From 3b01ca93cd446aa54496ed51c69857f2a5daf826 Mon Sep 17 00:00:00 2001 From: Nikolay Volf Date: Tue, 9 Feb 2016 22:30:35 +0300 Subject: [PATCH] call fail test --- ethcore/src/externalities.rs | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/ethcore/src/externalities.rs b/ethcore/src/externalities.rs index 2bf784134..b5a0c2539 100644 --- a/ethcore/src/externalities.rs +++ b/ethcore/src/externalities.rs @@ -355,10 +355,24 @@ mod tests { } #[test] - fn can_call_fail() { - let setup = TestSetup::new(); + fn can_call_fail_empty() { + let mut setup = TestSetup::new(); 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"); + } + } }