Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explore tx 3 #1722

Merged
merged 6 commits into from
May 3, 2022
Merged

Explore tx 3 #1722

merged 6 commits into from
May 3, 2022

Conversation

Jibz1
Copy link
Contributor

@Jibz1 Jibz1 commented May 2, 2022

Added transaction status on recent transactions
Gas use is now active
Switched to getTransactionWithEffects
Tx detail page shows the transaction status and failed status message.

Screen Shot 2022-05-02 at 6 06 55 PM
Screen Shot 2022-05-02 at 12 23 22 PM

Copy link
Contributor

@666lcz 666lcz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Requested change to put some common functions in the SDK

};

const getGasFeesAndStatus = (txStatusData: ExecutionStatus) => {
const istxSucces = Object.keys(txStatusData)[0].toLowerCase();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling a string istxSuccess is pretty confusing. Could you define

export type ExecutionStatusType = 'Success' | 'Failure';

in

export type ExecutionStatus =

as well as a SDK function like the following:

export function getExecutionStatusType(s: ExecutionStatus): ExecutionStatusType {
	return Object.keys(txStatusData)[0] as ExecutionStatusType;
}

txError: '',
};

const getGasFeesAndStatus = (txStatusData: ExecutionStatus) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This duplicates line 33 in explorer/client/src/components/transaction-card/RecentTxCard.tsx . Can you define these functions here instead since it's pretty common?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am working on moving it to the helper functions

return {
istxSucces,
txGas,
// txErr: txStatusData.Failure || '',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: remove

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

return {
istxSucces,
txGas,
// txErr: txStatusData.Failure || '',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: remove

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -51,10 +71,17 @@ const getRecentTransactions = async (txNum: number) => {
res.data
)?.recipient;

// TODO use ExecutionStatus and add a method on sui.js to get the gas data
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we do this in this PR? Let's do a huddle if you need help

Copy link
Contributor

@666lcz 666lcz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pressed the wrong button

@Jibz1
Copy link
Contributor Author

Jibz1 commented May 3, 2022

Gas payment added,
Prevent empty search
added getExecutionStatusType and ExecutionStatusType
some style changes
@666lcz
Screen Shot 2022-05-02 at 11 39 54 PM

@666lcz 666lcz merged commit aa913e7 into main May 3, 2022
@666lcz 666lcz deleted the explore-tx-3 branch May 3, 2022 06:21
longbowlu pushed a commit that referenced this pull request May 12, 2022
Co-authored-by: Chris Li <666lcz@gmail.com>
punwai pushed a commit that referenced this pull request Jul 27, 2022
Co-authored-by: Chris Li <666lcz@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants