-
Notifications
You must be signed in to change notification settings - Fork 151
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
refactor: do not generate SolCall for return values #134
Conversation
ea1b636
to
cf79abc
Compare
Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>
Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>
cf79abc
to
0eda8d4
Compare
/// pub struct #{name}Return { | ||
/// #(pub #return_name: #return_type,)* | ||
/// } | ||
/// | ||
/// impl SolCall for #{name}Return { | ||
/// impl SolFunction for #{name}Return { | ||
/// ... | ||
/// } |
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.
tbd
/// For example the following input: | ||
/// `function foo(uint256 a, uint256 b) external view returns (uint256);` |
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 is the doc comment's function
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.
yeah the rest of it was generic about macro functionality so i decided to be as explicit as possible
{ #converts } | ||
{ #return_converts } |
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.
what's the block for
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.
both generate a type alias named UnderlyingSolTuple. the scope prevents a name conflict
Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>
Closes #95
Motivation
Generating
SolCal
for return values led to bad outcomes like traits with incorrect signatures.Solution
Instead this PR simply treats the return type as a tuple (as solidity does), and adds
decode_returns
andencode_returns
functions to theSolCall
traitPR Checklist