call fail test
This commit is contained in:
parent
1603b2bf64
commit
3b01ca93cd
@ -355,10 +355,24 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn can_call_fail() {
|
fn can_call_fail_empty() {
|
||||||
let setup = TestSetup::new();
|
let mut setup = TestSetup::new();
|
||||||
let state = setup.state.reference_mut();
|
let state = setup.state.reference_mut();
|
||||||
let ext = Externalities::new(state, &setup.env_info, &*setup.engine, 0, get_test_origin(), &mut setup.sub_state, OutputPolicy::InitContract);
|
let mut ext = Externalities::new(state, &setup.env_info, &*setup.engine, 0, get_test_origin(), &mut setup.sub_state, OutputPolicy::InitContract);
|
||||||
}
|
|
||||||
|
|
||||||
|
let mut output = vec![];
|
||||||
|
|
||||||
|
let result = ext.call(
|
||||||
|
&U256::from_str("0000000000000000000000000000000000000000000000000000000000120000").unwrap(),
|
||||||
|
&Address::new(),
|
||||||
|
&Address::new(),
|
||||||
|
Some(U256::from_str("0000000000000000000000000000000000000000000000000000000000120000").unwrap()),
|
||||||
|
&vec![],
|
||||||
|
&Address::new(),
|
||||||
|
&mut output);
|
||||||
|
|
||||||
|
if let MessageCallResult::Success(_) = result {
|
||||||
|
panic!("Call should have failed because no data was provided");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user