From d2e53f95e0e4230684ef052684758c469d747260 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Fri, 15 Jan 2016 01:02:14 +0100 Subject: [PATCH] More State tests! --- src/executive.rs | 2 +- src/tests/state.rs | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/executive.rs b/src/executive.rs index cbaa1058d..65bc71aa2 100644 --- a/src/executive.rs +++ b/src/executive.rs @@ -252,7 +252,7 @@ impl<'a> Executive<'a> { let gas_left = match &result { &Ok(x) => x, _ => x!(0) }; let refund = cmp::min(sstore_refunds + suicide_refunds, (t.gas - gas_left) / U256::from(2)) + gas_left; let refund_value = refund * t.gas_price; - trace!("Refunding sender: gas_left: {}, refund: {}, refund_value: {}, sender: {}", gas_left, refund, refund_value, t.sender().unwrap()); + trace!("Refunding sender: sstore0s: {}, suicides: {}, gas_left: {}, refund: {}, refund_value: {}, sender: {}", sstore_refunds, suicide_refunds, gas_left, refund, refund_value, t.sender().unwrap()); self.state.add_balance(&t.sender().unwrap(), &refund_value); // fees earned by author diff --git a/src/tests/state.rs b/src/tests/state.rs index ce89003e1..1e3b6da6a 100644 --- a/src/tests/state.rs +++ b/src/tests/state.rs @@ -58,8 +58,22 @@ fn do_json_test(json_data: &[u8]) -> Vec { failed } -declare_test!{StateTests_stExample, "StateTests/stExample"} declare_test!{StateTests_stBlockHashTest, "StateTests/stBlockHashTest"} -declare_test!{StateTests_stLogTests, "StateTests/stLogTests"} declare_test!{StateTests_stCallCodes, "StateTests/stCallCodes"} -declare_test_ignore!{StateTests_stCallCreateCallCodeTest, "StateTests/stCallCreateCallCodeTest"} +declare_test_ignore!{StateTests_stCallCreateCallCodeTest, "StateTests/stCallCreateCallCodeTest"} // << XXX FIXME +declare_test!{StateTests_stDelegatecallTest, "StateTests/stDelegatecallTest"} +declare_test!{StateTests_stExample, "StateTests/stExample"} +declare_test!{StateTests_stInitCodeTest, "StateTests/stInitCodeTest"} +declare_test!{StateTests_stLogTests, "StateTests/stLogTests"} +declare_test!{StateTests_stMemoryStressTest, "StateTests/stMemoryStressTest"} +declare_test!{StateTests_stMemoryTest, "StateTests/stMemoryTest"} +declare_test!{StateTests_stPreCompiledContracts, "StateTests/stPreCompiledContracts"} +declare_test_ignore!{StateTests_stQuadraticComplexityTest, "StateTests/stQuadraticComplexityTest"} // << XXX FIXME +declare_test_ignore!{StateTests_stRecursiveCreate, "StateTests/stRecursiveCreate"} // << XXX FIXME +declare_test!{StateTests_stRefundTest, "StateTests/stRefundTest"} +declare_test!{StateTests_stSolidityTest, "StateTests/stSolidityTest"} +declare_test!{StateTests_stSpecialTest, "StateTests/stSpecialTest"} +declare_test!{StateTests_stSystemOperationsTest, "StateTests/stSystemOperationsTest"} +declare_test!{StateTests_stTransactionTest, "StateTests/stTransactionTest"} +declare_test!{StateTests_stTransitionTest, "StateTests/stTransitionTest"} +declare_test!{StateTests_stWalletTest, "StateTests/stWalletTest"}