-
Notifications
You must be signed in to change notification settings - Fork 161
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
Import/Export StateTree for Testing #1114
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.
This will shave a lot of time on our state migration testing. Thanks a lot @ec2
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.
These ErrorType::Other
variants strike me as shortcut around defining proper error types. Otherwise, this LGTM, just wanted to flag for a future error refactoring effort.
let state_root = forest_car::load_car(self.blockstore(), reader) | ||
.await | ||
.map_err(|e| Error::Other(format!("Import StateTree failed: {}", e.to_string())))?; | ||
if state_root.len() != 1 { |
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.
You could use pop and if it returns a None
variant return the error. This will get rid of indexing.
I guess, we need to move these methods out of chain. We require the import/export methods in interpreter crate ( error: cyclic package dependency: package `chain v0.1.0 (/home/ubuntu/forest/blockchain/chain)` depends on itself. Cycle:
package `chain v0.1.0 (/home/ubuntu/forest/blockchain/chain)`
... which is depended on by `interpreter v0.1.0 (/home/ubuntu/forest/vm/interpreter)`
... which is depended on by `chain v0.1.0 (/home/ubuntu/forest/blockchain/chain)` |
Summary of changes
Changes introduced in this pull request:
Reference issue to close (if applicable)
Closes
Other information and links