Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

[json-tests] populate state from genesis pod state #11083

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions ethcore/res/ethereum/tests-issues/currents.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@
"RevertPrecompiledTouch_storage_d0g0v0_ConstantinopleFix"
]
},
{
"reference": "issue https://github.com/paritytech/parity-ethereum/issues/11074",
"failing": "stReturnDataTest",
"subtests": [
"returndatasize_after_successful_callcode_d0g0v0_ConstantinopleFix"
]
},
{
"reference": "Issue https://github.com/paritytech/parity-ethereum/issues/11075",
"failing": "stSpecialTest",
Expand Down
2 changes: 2 additions & 0 deletions ethcore/spec/src/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ fn run_constructors<T: Backend>(
let start_nonce = engine.account_start_nonce(0);

let mut state = State::from_existing(db, root, start_nonce, factories.clone())?;
state.populate_from(genesis_state.clone());

// Execute contract constructors.
let env_info = EnvInfo {
Copy link
Collaborator

@dvdplm dvdplm Sep 23, 2019

Choose a reason for hiding this comment

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

So this is not used when self.constructors is empty, nor is from below. Maybe wrap the whole block in an if !constructors.empty() and move the state.commit() outside?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't have a strong opinion about this change, but it's out of scope of this PR, feel free to commit it directly to your branch after this PR is merged.

Expand Down Expand Up @@ -177,6 +178,7 @@ fn run_constructors<T: Backend>(

let _ = state.commit()?;
}
let _ = state.commit()?;

Ok(state.drop())
}
Expand Down