-
Notifications
You must be signed in to change notification settings - Fork 28
Small Updates #282
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
Small Updates #282
Conversation
Codecov Report
Additional details and impacted files
|
Buckram123
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.
Will be nice to have a little test with 3+ contracts ( could be in another PR )
cw-orch/src/snapshots.rs
Outdated
| use ::cw_orch::environment::{ChainState as _, StateInterface as _}; | ||
| let all_contract_addresses = $chain.state().get_all_addresses()?; | ||
| let mut all_storage = ::std::collections::HashMap::new(); | ||
| let mut all_storage = 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.
Why not use BTreeMap?
and nit: you can pass capacity of all_contract_addresses length for Vec here
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.
Hm, yeah better like so
| let all_contracts = $chain.state().get_all_addresses()?; | ||
| let all_storage: ::std::collections::BTreeMap<_, _> = all_contracts | ||
| .iter() | ||
| .map(|(id, contract_addr)| { | ||
| ( | ||
| id, | ||
| ::cw_orch::snapshots::parse_storage( | ||
| &$chain.app.borrow().dump_wasm_raw(&contract_addr), | ||
| ), | ||
| ) | ||
| }) | ||
| .collect(); |
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.
🔥
Uh oh!
There was an error while loading. Please reload this page.