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: decode sc metadata #5274
feat: decode sc metadata #5274
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.
1 question + 1 code change
const ethereumAddress = '0x' + smartContractParameters['a'].substring(2) | ||
const forceOpenAccount = smartContractParameters['c'] === FORCE_OPEN_ACCOUNT |
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.
not related to your PR, but why are those fields called "a" and "c"?
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.
They are kind of arbitrary, but not something that will be changed before the release.
You can find a list for the parameter calls the accounts contract here: https://github.com/iotaledger/wasp/blob/gpa/packages/vm/core/accounts/interface.go#L62-L76
const gasBudget = readStream.readUInt64('gasBudget') | ||
|
||
const smartContractParameters = parseSmartContractParameters(readStream) | ||
const { baseTokenAmount, nativeTokens } = parseAllowance(readStream) |
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 throws an error if parseAllowance(readStream)
returns undefined
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, gj!
Summary
This PR adds functionality to parse metadata relevant to a smart contract call in a human friendly format
...
Changelog
Relevant Issues
closes: #5216
Testing
Platforms
Instructions
...
Checklist