-
Notifications
You must be signed in to change notification settings - Fork 112
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
Specify return variable names for functions with public interfaces #273
Specify return variable names for functions with public interfaces #273
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.
I was a little twitchy about the underlying contracts not being updated to use the same return declarations but that is probably ok
/// @return amount Total amount of tokens taken aside for reward payout | ||
/// @return tokenAddress Token address | ||
/// @return blockTimestamp Block number at the time of creation | ||
function getRewardPayoutInfo(uint256 _payoutId) public view returns (bytes32 reputationState, uint256 totalTokens, uint256 amount, address tokenAddress, uint256 blockTimestamp); |
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 understand you think this is unused but eventually when we come to returning the entire RewardPayoutCycle
struct, that will return all 5 members regardless and reverting back to it will be a breaking change. Let's keep it 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.
Okay, that makes sense; I'll rebase and skip this commit 👍
1c83522
to
2305278
Compare
Yes, I considered whether that would be necessary or useful, but perhaps it's more work than it's worth, unless we enforce it globally with linting for example. |
It seems like I'll rebase onto this (so we won't have the remaining token amount entry). |
033b4c7
to
df31d2c
Compare
* `startNextRewardPayout` appears to have no return value; correct the interface signature
* Add names for every return variable for the interface contracts
* Specify variable names for every NatSpec `@return` entry (for the interface contracts)
df31d2c
to
215d867
Compare
This PR makes some alterations to the interface contracts in order to specify the names of all function returns. One benefit of this is that the ABI now receives the return variable names, which makes making sense of returned values simpler.
The difference in the truffle artifact generated looks like this:
Other changes
@return
entries now reference the relevant variable namegetRewardPayoutInfo
)startNextRewardPayout
appears to have no return value; remove this from the interface