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

Improve handling of custom errors in receipts - capture returnValue #112

Merged
merged 1 commit into from
Mar 14, 2024

Conversation

peterbroadhurst
Copy link
Contributor

See hyperledger/firefly#1466 for details

This PR is the first step of capturing the returnValue in cases it cannot be parsed as a default error

@peterbroadhurst peterbroadhurst requested a review from a team as a code owner February 19, 2024 20:06
@@ -174,7 +174,7 @@ const sampleTransactionTraceBesu = `{
"0000000000000000000000000000000000000000000000000000000000000000"
],
"storage": {},
"reason": "0x8c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000114e6f7420656e6f75676820746f6b656e73000000000000000000000000000000"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was not a correct error - there is a missing 0 in the default Error(string) function selector 0x08c379a0

Copy link
Contributor

@matthew1001 matthew1001 Apr 4, 2024

Choose a reason for hiding this comment

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

@peterbroadhurst some nodes return the error in that format (i.e. with an odd-number of hex digits) and assume that you will pad with a single 0 client-side if it's odd. The new value you've used is valid, but the reason for including this particular reason was to emulate nodes which do that.

Copy link
Contributor

@Chengxuan Chengxuan left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants