executive tests fixed
Conflicts: src/executive.rs
This commit is contained in:
@@ -97,3 +97,20 @@ macro_rules! evm_test(
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! evm_test_ignore(
|
||||
($name_test: ident: $name_jit: ident, $name_int: ident) => {
|
||||
#[test]
|
||||
#[ignore]
|
||||
#[cfg(feature = "jit")]
|
||||
fn $name_jit() {
|
||||
$name_test(Factory::new(VMType::Jit));
|
||||
}
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn $name_int() {
|
||||
$name_test(Factory::new(VMType::Interpreter));
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@@ -653,7 +653,7 @@ impl Interpreter {
|
||||
let big_id = stack.pop_back();
|
||||
let id = big_id.low_u64() as usize;
|
||||
let max = id.wrapping_add(32);
|
||||
let data = params.data.clone().unwrap();
|
||||
let data = params.data.clone().unwrap_or(vec![]);
|
||||
let bound = cmp::min(data.len(), max);
|
||||
if id < bound && big_id < U256::from(data.len()) {
|
||||
let mut v = data[id..bound].to_vec();
|
||||
@@ -664,7 +664,7 @@ impl Interpreter {
|
||||
}
|
||||
},
|
||||
instructions::CALLDATASIZE => {
|
||||
stack.push(U256::from(params.data.clone().unwrap().len()));
|
||||
stack.push(U256::from(params.data.clone().unwrap_or(vec![]).len()));
|
||||
},
|
||||
instructions::CODESIZE => {
|
||||
stack.push(U256::from(code.len()));
|
||||
@@ -675,10 +675,10 @@ impl Interpreter {
|
||||
stack.push(U256::from(len));
|
||||
},
|
||||
instructions::CALLDATACOPY => {
|
||||
self.copy_data_to_memory(mem, stack, ¶ms.data.clone().unwrap());
|
||||
self.copy_data_to_memory(mem, stack, ¶ms.data.clone().unwrap_or(vec![]));
|
||||
},
|
||||
instructions::CODECOPY => {
|
||||
self.copy_data_to_memory(mem, stack, ¶ms.code.clone().unwrap());
|
||||
self.copy_data_to_memory(mem, stack, ¶ms.code.clone().unwrap_or(vec![]));
|
||||
},
|
||||
instructions::EXTCODECOPY => {
|
||||
let address = u256_to_address(&stack.pop_back());
|
||||
|
||||
Reference in New Issue
Block a user