-
Notifications
You must be signed in to change notification settings - Fork 148
Add more methods to MultiGas struct #483
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
Conversation
@gligneul, are you ready for review? If so, can you click, "Ready for review", give it a proper PR description and assign this to me? |
There are quite a few things missing. I will open it soon. |
Add a function that only increments a single resource kind instead of adding up two multi-gas. Also checks for overflows in the functions.
I decided to open this PR with just the multigas methods. Later, I will open another PR passing the multigas variable to the interpreter. |
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.
Overall everything looks good, there is one small suggestion:
func (mg *MultiGas) ToLegacyGas() uint64 {
var sum uint64
for _, value := range mg.gas {
sum = math.SafeAdd(sum, value)
}
return sum
}
it will help me in the tests
I would like to not call such a method |
No description provided.