Calculate post-constructors state root in spec at load time (#5523)

* apply contract constructors at spec load time

* debugging

* do trie updates in two stages

* add lint exception to newly-dead constructor

* squash warning in RPC tests

* kill dead accountdb constructors

* restore accountdb constructors under test configuration

* use provided state root in spec, if it exists
This commit is contained in:
Robert Habermeier
2017-05-03 09:00:02 +02:00
committed by Gav Wood
parent 5fd5c9e85c
commit 60bb0de9d6
9 changed files with 196 additions and 123 deletions

View File

@@ -83,7 +83,7 @@ fn make_spec(chain: &BlockChain) -> Spec {
let genesis = Genesis::from(chain.genesis());
let mut spec = ethereum::new_frontier_test();
let state = chain.pre_state.clone().into();
spec.set_genesis_state(state);
spec.set_genesis_state(state).expect("unable to set genesis state");
spec.overwrite_genesis_params(genesis);
assert!(spec.is_state_root_valid());
spec