Skip to content
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

Fixes to mock runtime #246

Merged
merged 2 commits into from
Apr 21, 2022
Merged

Fixes to mock runtime #246

merged 2 commits into from
Apr 21, 2022

Conversation

anorth
Copy link
Member

@anorth anorth commented Apr 18, 2022

Closes #196

@anorth anorth requested review from Stebalien and ZenGround0 April 18, 2022 16:56
@@ -777,12 +777,12 @@ impl Runtime<MemoryBlockstore> for MockRuntime {
if self.state.is_some() {
return Err(actor_error!(illegal_state; "state already constructed"));
}
self.state = Some(self.store.put_cbor(obj, Code::Blake2b256).unwrap());
self.state = Some(self.store_put(obj));
Ok(())
}

fn state<C: Cbor>(&self) -> Result<C, ActorError> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

state() seems to only be used by get_state() so can now be removed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is implementing the trait for actor use.

actors/runtime/src/test_utils.rs Outdated Show resolved Hide resolved
@anorth anorth enabled auto-merge (squash) April 21, 2022 09:37
@anorth anorth merged commit f32e7fd into master Apr 21, 2022
@anorth anorth deleted the anorth/mockfix branch April 21, 2022 09:42
adlrocha pushed a commit to consensus-shipyard/builtin-actors that referenced this pull request Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mock runtime should not return ActorError for expectation violations
3 participants