-
Notifications
You must be signed in to change notification settings - Fork 11.4k
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
Explore tx 3 #1722
Conversation
There was a problem hiding this 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(); |
There was a problem hiding this comment.
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) => { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 || '', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove
There was a problem hiding this comment.
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 || '', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this 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
Gas payment added, |
Co-authored-by: Chris Li <666lcz@gmail.com>
Co-authored-by: Chris Li <666lcz@gmail.com>
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.