Skip to content

Commit 968caea

Browse files
committed
state: Rename Transaction::Type::{eip2930→access_list}
1 parent 366ad6e commit 968caea

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

test/state/state.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ std::variant<int64_t, std::error_code> validate_transaction(const Account& sende
6767
return make_error_code(TIP_GT_FEE_CAP); // Priority gas price is too high.
6868
[[fallthrough]];
6969

70-
case Transaction::Type::eip2930:
70+
case Transaction::Type::access_list:
7171
if (rev < EVMC_BERLIN)
7272
return make_error_code(TX_TYPE_NOT_SUPPORTED);
7373
[[fallthrough]];
@@ -226,7 +226,7 @@ std::variant<TransactionReceipt, std::error_code> transition(
226226
return rlp::encode_tuple(tx.nonce, tx.max_gas_price, static_cast<uint64_t>(tx.gas_limit),
227227
tx.to.has_value() ? tx.to.value() : bytes_view(), tx.value, tx.data, tx.v, tx.r, tx.s);
228228
}
229-
else if (tx.type == Transaction::Type::eip2930)
229+
else if (tx.type == Transaction::Type::access_list)
230230
{
231231
if (tx.v > 1)
232232
throw std::invalid_argument("`v` value for eip2930 transaction must be 0 or 1");

test/state/state.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ struct Transaction
104104

105105
/// The typed transaction with optional account/storage access list.
106106
/// Introduced by EIP-2930 https://eips.ethereum.org/EIPS/eip-2930.
107-
eip2930 = 1,
107+
access_list = 1,
108108

109109
/// The typed transaction with priority gas price.
110110
/// Introduced by EIP-1559 https://eips.ethereum.org/EIPS/eip-1559.

test/statetest/statetest_loader.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ state::Transaction from_json<state::Transaction>(const json::json& j)
288288
{
289289
o.access_list = from_json<state::AccessList>(*ac_it);
290290
if (o.type == state::Transaction::Type::legacy) // Upgrade tx type if tx has access list
291-
o.type = state::Transaction::Type::eip2930;
291+
o.type = state::Transaction::Type::access_list;
292292
}
293293

294294
if (const auto type_it = j.find("type"); type_it != j.end())
@@ -317,7 +317,7 @@ static void from_json(const json::json& j, TestMultiTransaction& o)
317317
for (const auto& j_access_list : *ac_it)
318318
o.access_lists.emplace_back(from_json<state::AccessList>(j_access_list));
319319
if (o.type == state::Transaction::Type::legacy) // Upgrade tx type if tx has access lists
320-
o.type = state::Transaction::Type::eip2930;
320+
o.type = state::Transaction::Type::access_list;
321321
}
322322

323323
for (const auto& j_gas_limit : j.at("gasLimit"))

test/unittests/state_rlp_test.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ TEST(state_rlp, tx_to_rlp_eip1559_invalid_v_value)
383383
TEST(state_rlp, tx_to_rlp_eip2930_invalid_v_value)
384384
{
385385
state::Transaction tx{};
386-
tx.type = evmone::state::Transaction::Type::eip2930;
386+
tx.type = evmone::state::Transaction::Type::access_list;
387387
tx.data = ""_hex;
388388
tx.gas_limit = 1;
389389
tx.max_gas_price = 1;
@@ -431,7 +431,7 @@ TEST(state_rlp, tx_to_rlp_eip2930_with_non_empty_access_list)
431431
// https://etherscan.io/tx/0xf076e75aa935552e20e5d9fd4d1dda4ff33399ff3d6ac22843ae646f82c385d4
432432

433433
state::Transaction tx{};
434-
tx.type = evmone::state::Transaction::Type::eip2930;
434+
tx.type = evmone::state::Transaction::Type::access_list;
435435
tx.data =
436436
"0x095ea7b3000000000000000000000000f17d23136b4fead139f54fb766c8795faae09660ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"_hex;
437437
tx.gas_limit = 51253;

test/unittests/statetest_loader_tx_test.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ TEST(statetest_loader, tx_type_1)
163163
})";
164164

165165
const auto tx = test::from_json<state::Transaction>(json::json::parse(input));
166-
EXPECT_EQ(tx.type, state::Transaction::Type::eip2930);
166+
EXPECT_EQ(tx.type, state::Transaction::Type::access_list);
167167
EXPECT_TRUE(tx.data.empty());
168168
EXPECT_EQ(tx.gas_limit, 0);
169169
EXPECT_EQ(tx.value, 0);

0 commit comments

Comments
 (0)