@@ -83,7 +83,8 @@ static BlockBody sample_block_body(bool with_block_extra_data=true) {
8383
8484 if (with_block_extra_data) {
8585 body.eosevm_extra_data = {
86- .consensus_parameter_index = 0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3_bytes32
86+ .consensus_parameter_index = 0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3_bytes32,
87+ .gasprices = eosevm::gas_prices{1 , 2 }
8788 };
8889 }
8990
@@ -510,6 +511,8 @@ TEST_CASE("Headers and bodies") {
510511 CHECK (block.eosevm_extra_data .has_value () == true );
511512 CHECK (block.eosevm_extra_data .value ().consensus_parameter_index .has_value () == true );
512513 CHECK (block.eosevm_extra_data ->consensus_parameter_index == 0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3_bytes32);
514+ CHECK (block.eosevm_extra_data ->gasprices ->overhead_price == 1 );
515+ CHECK (block.eosevm_extra_data ->gasprices ->storage_price == 2 );
513516
514517 CHECK (!block.transactions [0 ].from );
515518 CHECK (!block.transactions [1 ].from );
@@ -563,6 +566,8 @@ TEST_CASE("Headers and bodies") {
563566 CHECK (block.eosevm_extra_data .has_value () == true );
564567 CHECK (block.eosevm_extra_data .value ().consensus_parameter_index .has_value () == true );
565568 CHECK (block.eosevm_extra_data ->consensus_parameter_index == 0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3_bytes32);
569+ CHECK (block.eosevm_extra_data ->gasprices ->overhead_price == 1 );
570+ CHECK (block.eosevm_extra_data ->gasprices ->storage_price == 2 );
566571 });
567572 REQUIRE (processed == 1 );
568573 REQUIRE (processed == count);
@@ -987,47 +992,4 @@ TEST_CASE("ConsensusParameters") {
987992 CHECK (read_consensus_parameters (txn, value2.hash ()) == value2);
988993}
989994
990- TEST_CASE (" gas_prices" ) {
991- test::Context context;
992- auto & txn{context.rw_txn ()};
993-
994- constexpr eosevm::gas_prices value1{
995- .overhead_price = 1 ,
996- .storage_price = 1
997- };
998-
999- auto tmp = value1.encode ();
1000-
1001- ByteView bv{tmp};
1002- REQUIRE_NOTHROW (eosevm::gas_prices::decode (bv));
1003-
1004- constexpr eosevm::gas_prices value2{
1005- .overhead_price = 2 ,
1006- .storage_price = 2
1007- };
1008-
1009- CHECK (read_gas_prices (txn, evmc::bytes32 (0 )) == std::nullopt );
1010-
1011- update_gas_prices (txn, evmc::bytes32 (0 ), value1 );
1012- CHECK (read_gas_prices (txn, evmc::bytes32 (0 )) == value1);
1013-
1014- update_gas_prices (txn, evmc::bytes32 (0 ), value2 );
1015- CHECK (read_gas_prices (txn, evmc::bytes32 (0 )) == value2);
1016-
1017- CHECK (read_gas_prices (txn, evmc::bytes32 (1 )) == std::nullopt );
1018-
1019- update_gas_prices (txn, evmc::bytes32 (1 ), value2 );
1020- CHECK (read_gas_prices (txn, evmc::bytes32 (1 )) == value2);
1021-
1022- update_gas_prices (txn, evmc::bytes32 (1 ), value1 );
1023- CHECK (read_gas_prices (txn, evmc::bytes32 (1 )) == value1);
1024-
1025- update_gas_prices (txn, value1.hash (), value1 );
1026- CHECK (read_gas_prices (txn, value1.hash ()) == value1);
1027-
1028- update_gas_prices (txn, value2.hash (), value2 );
1029- CHECK (read_gas_prices (txn, value2.hash ()) == value2);
1030- }
1031-
1032-
1033995} // namespace silkworm::db
0 commit comments