-
Notifications
You must be signed in to change notification settings - Fork 55
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
feat: added a new flow to let users manually configure transactions' gas limit on the System Contract DApp #678
feat: added a new flow to let users manually configure transactions' gas limit on the System Contract DApp #678
Conversation
Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: Logan Nguyen <[email protected]>
Signed-off-by: Logan Nguyen <[email protected]>
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.
LG
Minor edit but repeated many times
MOCK_TX_HASH, | ||
MOCK_GAS_LIMIT, | ||
MOCK_HEDERA_NETWORK, | ||
MOCK_SINGER_ADDRESS, |
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.
MOCK_SINGER_ADDRESS, | |
MOCK_SIGNER_ADDRESS, |
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.
Oh thanks for the nice catch!
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.
lgtm, left some details comments
'cryptoTransferPublic', | ||
[transferList, tokenTransferList] | ||
); | ||
if (!estimateGasResult.gasLimit || estimateGasResult.err) return { err: estimateGasResult.err }; |
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 see this logic is duplicated in each of these APIs, do you think is worth to refactor it to avoid this duplication?
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.
That's a great suggestion Luis, I appreciate it! You're right this logic recurs in most of the API calls. I've devised another plan to address this by crafting a more robust error handler, which I'll integrate into another PR. 😄
accountId?: string; | ||
contractId?: string; | ||
err?: any; | ||
} | ||
|
||
/** | ||
* @dev an interface for the results returned back from querying estimated gasLimit to the Mirror Node |
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.
small detail: Is @dev
a valid TSDoc https://tsdoc.org/ annotation?
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.
Ahh you're right at the beginning I just brought this annotation over from Solidity and didn't do any research on this! Will create a ticket for this soon! Thanks a lot for pointing it out!
*/ | ||
interface IEstimateGasMirrorNodeResult { | ||
gasLimit?: number; | ||
err?: any; |
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.
Does it make sense to write a small explanation on why err
is any
here? In other words, where err
does come from? Something like, the type of Exception that has been thrown when doing the request to the mirror node
.
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.
Excellent suggestion! This I will keep in mind when I integrate the new error handler I mentioned above! Thanks Luis!
Signed-off-by: Logan Nguyen <[email protected]>
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.
lg
Description:
This PR has implemented a new gas estimation mechanism for the System Contract DApp Playground. With this enhancement, users can now specify custom gas limits for transactions manually. In cases where no gas limits are provided, the transactions' calldata will be forwarded to a mirror-node for calculating the necessary gas limit. This improved flow is now accessible to all transactions undergoing consensus.
Related issue(s):
Fixes #668
UI Updates:
Transactions will now have an extra textbox next to their execute buttons which receive custom gas limits.
Notes for reviewer:
Checklist