-
Notifications
You must be signed in to change notification settings - Fork 441
chore(example): minor improvement for grc20 #4923
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
base: master
Are you sure you want to change the base?
Conversation
🛠 PR Checks SummaryAll Automated Checks passed. ✅ Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):🟢 Maintainers must be able to edit this pull request (more info) ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
| // the validity of the owner and spender is verified within spendAllowance. | ||
| // by this point, all pre-checks pass, ensure the atomicity of the following calls. | ||
| if err := led.spendAllowance(owner, spender, amount); err != nil { | ||
| return err |
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.
is this truly an improvement over the old code?
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.
merging the repeated code looks good, but I don't understand why to unexport spendAllowance
cc @moul
| // spendAllowance decreases the allowance of the specified owner and spender. | ||
| func (led *PrivateLedger) spendAllowance(owner, spender address, amount int64) error { |
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.
| // spendAllowance decreases the allowance of the specified owner and spender. | |
| func (led *PrivateLedger) spendAllowance(owner, spender address, amount int64) error { | |
| // SpendAllowance decreases the allowance of the specified owner and spender. | |
| func (led *PrivateLedger) SpendAllowance(owner, spender address, amount int64) error { |
This admin helper should be callable by an external realm.
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.
Please also keep the function implementation around line 82 as before to minimise the difference in the diff. This contract was already reviewed during security audits and we should aim for minimal changes now.
moul
left a comment
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.
See comments.
No description provided.