-
Notifications
You must be signed in to change notification settings - Fork 13
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
Generate Solidity style full descriptions of functions/events/structs #71
Conversation
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
…nctions Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
…s/structs Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
buff.WriteRune(')') | ||
|
||
if isFunction { | ||
buff.WriteString(" external") |
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.
Why include "external" in the descriptor if it's the same for all functions? Is it just to make it read more like a proper Solidity function definition?
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.
Exactly that.
It allows you to paste it into a code editor in an interface or actual .sol
file and it work as-is
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 asked some questions inline, but I think this looks good.
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
…ly-signer into solidity-defs
In PR chain with #70
firefly-signer/pkg/abi/abi_test.go
Lines 1002 to 1017 in 97939c6
There are cases where we need to build descriptors of functions/events (and their containing structures) that preserve the full information of how they will be parsed/serialized.
For example when determining if the list of event definitions, including containing type names, is identical to another list.
This PR provides that feature, and does it uses
Solidity
as the inspiration for the formatting, which makes it human readable.The solidity strings have the characteristic that they uniquely identify each function, including where overrides are used.