diff --git a/test/state/state.cpp b/test/state/state.cpp index 3e33b7367e..fc9c540fd0 100644 --- a/test/state/state.cpp +++ b/test/state/state.cpp @@ -10,6 +10,8 @@ #include #include +#include + namespace evmone::state { namespace @@ -30,12 +32,12 @@ size_t compute_tx_data_tokens(evmc_revision rev, bytes_view data) noexcept int64_t compute_access_list_cost(const AccessList& access_list) noexcept { - static constexpr auto storage_key_cost = 1900; - static constexpr auto address_cost = 2400; + static constexpr auto ADDRESS_COST = 2400; + static constexpr auto STORAGE_KEY_COST = 1900; int64_t cost = 0; - for (const auto& a : access_list) - cost += address_cost + static_cast(a.second.size()) * storage_key_cost; + for (const auto& keys : std::views::values(access_list)) + cost += ADDRESS_COST + static_cast(keys.size()) * STORAGE_KEY_COST; return cost; }