Skip to content

Commit

Permalink
Add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
rodiazet committed Apr 20, 2023
1 parent cc6431c commit ab1c40c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test/unittests/state_transition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void state_transition::TearDown()
ASSERT_TRUE(holds_alternative<TransactionReceipt>(res))
<< std::get<std::error_code>(res).message();
const auto& receipt = std::get<TransactionReceipt>(res);
evmone::state::finalize(state, rev, block.coinbase, 0, {});
evmone::state::finalize(state, rev, block.coinbase, 0, block.withdrawals);

EXPECT_EQ(receipt.status, expect.status);
if (expect.gas_used.has_value())
Expand Down
8 changes: 8 additions & 0 deletions test/unittests/state_transition_create_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,11 @@ TEST_F(state_transition, create_tx)

expect.post[create_address].code = bytes{0xFE};
}

TEST_F(state_transition, apply_withdrawal)
{
static constexpr auto withdrawal_address = 0x8ef300b6a6a0b41e4f5d717074d9fd5c605c7285_address;

block.withdrawals = {{withdrawal_address, 3}};
expect.post[withdrawal_address].balance = intx::uint256{3} * 1e9;
}

0 comments on commit ab1c40c

Please sign in to comment.