-
Notifications
You must be signed in to change notification settings - Fork 790
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
VM: stateManager -> add modifyAccountFields method #1369
Conversation
Codecov Report
Flags with carried forward coverage won't be shown. Click here to find out more. |
Per previous comments, |
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 looks great. I added one additional test to prove out the fact that modifying a non-existent account will first create an empty one and then update its values accordingly.
I don't know the reasoning behind throwing if the account does not exist. I'd say it makes much sense, and is consistent, to just take the empty account and then modify these fields. |
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 looks good to me!
looks great. is there anywhere we can use this new method within our own internal VM then? or is it just a convenience helper for external use? |
@ryanio Ah, yes I think there are some spots internally where this new method could be used. Should I include that as part of this PR or tackle separately? |
I say let's include it as part of this PR, so that the changes are contained together nicely. |
PR updated with some usage changes |
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.
looks really great!
Addresses #731.
This was my first time working with
stateManager
and I was learning as I went, so any feedback, suggestions, or critique are welcomed.There was one part of the original issue that I wasn't able to figure out:
The method should probably throw if account doesn't exist.
. I attempted that but couldn't get it to work, and after some digging, it looks like if the account doesn't exist, a new one will be created, so an account always exists whengetAccount
is called. Is there something I'm not understanding?