Skip to content

Commit

Permalink
Fix unit_tests: Set gas prices before switching to v3
Browse files Browse the repository at this point in the history
  • Loading branch information
elmato committed Feb 4, 2025
1 parent 2bfdef3 commit 4f3db22
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
7 changes: 7 additions & 0 deletions tests/gas_param_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,13 @@ BOOST_FIXTURE_TEST_CASE(gas_param_traces, gas_param_evm_tester) try {

init();

// We need to have some gas prices active before switching to v3
silkworm::gas_prices_t gas_prices1{
.overhead_price = 80*silkworm::kGiga,
.storage_price = 70*silkworm::kGiga
};
setgasprices({.overhead_price=gas_prices1.overhead_price, .storage_price=gas_prices1.storage_price});

setversion(3, evm_account_name);
produce_blocks(2);

Expand Down
12 changes: 8 additions & 4 deletions tests/gas_prices_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ BOOST_FIXTURE_TEST_CASE(gas_param_scale, gas_prices_evm_tester) try {
/////////////////////////////////////
/// change EOS EVM VERSION => 3 ///
/////////////////////////////////////

// We need to have some gas prices active before switching to v3
silkworm::gas_prices_t gas_prices1{
.overhead_price = 80*kGiga,
.storage_price = 70*kGiga
};
setgasprices({.overhead_price=gas_prices1.overhead_price, .storage_price=gas_prices1.storage_price});

setversion(3, evm_account_name);
fund_evm_faucet();
produce_block();
Expand Down Expand Up @@ -223,10 +231,6 @@ BOOST_FIXTURE_TEST_CASE(gas_param_scale, gas_prices_evm_tester) try {
validate_final_fee(res, 31250, std::get<4>(res).G_newaccount, gas_prices);
};

silkworm::gas_prices_t gas_prices1{
.overhead_price = 80*kGiga,
.storage_price = 70*kGiga
};
run_gasparams_scale_test(gas_prices1);

silkworm::gas_prices_t gas_prices2{
Expand Down

0 comments on commit 4f3db22

Please sign in to comment.