EIP2929 with journaling + Yolov3 (#79)
This commit is contained in:
@@ -167,6 +167,10 @@ where
|
||||
Ok(ContractCreateResult::Created(contract_address, *gas))
|
||||
}
|
||||
|
||||
fn calc_address(&self, code: &[u8], address: CreateContractAddress) -> Option<Address> {
|
||||
Some(contract_address(address, &self.sender, &self.nonce, &code).0)
|
||||
}
|
||||
|
||||
fn call(
|
||||
&mut self,
|
||||
gas: &U256,
|
||||
@@ -238,6 +242,26 @@ where
|
||||
fn sub_sstore_refund(&mut self, value: usize) {
|
||||
self.ext.sub_sstore_refund(value)
|
||||
}
|
||||
|
||||
fn al_is_enabled(&self) -> bool {
|
||||
self.ext.al_is_enabled()
|
||||
}
|
||||
|
||||
fn al_contains_storage_key(&self, address: &Address, key: &H256) -> bool {
|
||||
self.ext.al_contains_storage_key(address, key)
|
||||
}
|
||||
|
||||
fn al_insert_storage_key(&mut self, address: Address, key: H256) {
|
||||
self.ext.al_insert_storage_key(address, key)
|
||||
}
|
||||
|
||||
fn al_contains_address(&self, address: &Address) -> bool {
|
||||
self.ext.al_contains_address(address)
|
||||
}
|
||||
|
||||
fn al_insert_address(&mut self, address: Address) {
|
||||
self.ext.al_insert_address(address)
|
||||
}
|
||||
}
|
||||
|
||||
/// run an json executive test
|
||||
|
||||
@@ -68,7 +68,6 @@ pub fn json_chain_test<H: FnMut(&str, HookType)>(
|
||||
let pre: PodState = test.pre_state.into();
|
||||
|
||||
for (spec_name, states) in test.post_states {
|
||||
let total = states.len();
|
||||
let spec = match EvmTestClient::spec_from_json(&spec_name) {
|
||||
Some(spec) => spec,
|
||||
None => {
|
||||
@@ -81,11 +80,10 @@ pub fn json_chain_test<H: FnMut(&str, HookType)>(
|
||||
|
||||
for (i, state) in states.into_iter().enumerate() {
|
||||
let info = format!(
|
||||
" - state: {} | {:?} ({}/{}) ...",
|
||||
name,
|
||||
"TestState/{}/{:?}/{}/trie",
|
||||
path.to_string_lossy(),
|
||||
spec_name,
|
||||
i + 1,
|
||||
total
|
||||
i
|
||||
);
|
||||
if skip_test(&state_test, &name, &spec.name, i + 1) {
|
||||
println!("{}: SKIPPED", info);
|
||||
@@ -112,7 +110,7 @@ pub fn json_chain_test<H: FnMut(&str, HookType)>(
|
||||
}
|
||||
Ok(Ok(TransactSuccess { state_root, .. })) if state_root != post_root => {
|
||||
println!(
|
||||
"{} !!! State mismatch (got: {}, expect: {}",
|
||||
"{}: post state root mismatch: got {:?}, want {:?}",
|
||||
info, state_root, post_root
|
||||
);
|
||||
flushln!("{} fail", info);
|
||||
@@ -124,7 +122,7 @@ pub fn json_chain_test<H: FnMut(&str, HookType)>(
|
||||
..
|
||||
})) if state_root != post_root => {
|
||||
println!(
|
||||
"{} !!! State mismatch (got: {}, expect: {}",
|
||||
"{}: post state root mismatch: got {:?}, want {:?}",
|
||||
info, state_root, post_root
|
||||
);
|
||||
println!("{} !!! Execution error: {:?}", info, error);
|
||||
|
||||
Reference in New Issue
Block a user