Skip to content

Commit

Permalink
test calls
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Aug 19, 2022
1 parent dc77657 commit 490116d
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion test/unittests/evm_calls_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ TEST_P(evm, call_gas_refund_propagation)
}
}

TEST_P(evm, call_gas_refund_aggregation)
TEST_P(evm, call_gas_refund_aggregation_different_calls)
{
rev = EVMC_LONDON;
host.accounts[msg.recipient].set_balance(1);
Expand All @@ -770,3 +770,20 @@ TEST_P(evm, call_gas_refund_aggregation)
EXPECT_STATUS(EVMC_SUCCESS);
EXPECT_EQ(result.gas_refund, 6);
}

TEST_P(evm, call_gas_refund_aggregation_same_calls)
{
rev = EVMC_LONDON;
host.accounts[msg.recipient].set_balance(2);
host.call_result.status_code = EVMC_SUCCESS;
host.call_result.gas_refund = 1;

const auto code_prolog = 14 * push(1);
for (const auto op :
{OP_CALL, OP_CALLCODE, OP_DELEGATECALL, OP_STATICCALL, OP_CREATE, OP_CREATE2})
{
execute(code_prolog + 2 * op);
EXPECT_STATUS(EVMC_SUCCESS);
EXPECT_EQ(result.gas_refund, 2);
}
}

0 comments on commit 490116d

Please sign in to comment.