-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Add initialization for the genesis base asset contract #2304
Add initialization for the genesis base asset contract #2304
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.
left a couple qs
let key = ContractsStateKey::new(contract_id, &storage_key); | ||
let contains = storage | ||
.storage_as_mut::<ContractsState>() | ||
.contains_key(&key)?; |
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.
qq: what was the previous value stored in the keys defined by STATE
? does zeroing them out fix it?
let entries = view | ||
.iter_all::<ContractsState>(None) | ||
.map(|r| r.unwrap()) | ||
.collect::<Vec<_>>(); |
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.
iter_all_keys
perhaps? but then again, we don't test the values and this length would be the same before and after running maybe_fix_contract
right?
## Version v0.37.1 ### Fixed - [2304](#2304): Add initialization for the genesis base asset contract. ## What's Changed * Add initialization for the genesis base asset contract by @xgreenx in #2304 **Full Changelog**: v0.37.0...v0.37.1
This match initializes storage slots for the genesis base asset contract(because we forgot to add it).
In the next release we will remove it form our codebase=)
Side change:
ChangesIterator
to thefuel-core-storage
crate to allow usage in the tests.Checklist
Before requesting review