Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
elmato committed Mar 21, 2024
1 parent 5f5caaa commit 587589b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/basic_evm_tester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -681,10 +681,10 @@ intx::uint128 basic_evm_tester::tx_data_cost(const silkworm::Transaction& txn) c
}

const intx::uint128 non_zero_bytes{as_range::count_if(txn.data, [](uint8_t c) { return c != 0; })};
const intx::uint128 nonZeroGas{silkworm::fee::kGTxDataNonZeroIstanbul};
const intx::uint128 nonZeroGas{silkworm::protocol::fee::kGTxDataNonZeroIstanbul};
gas += non_zero_bytes * nonZeroGas;
const intx::uint128 zero_bytes{data_len - non_zero_bytes};
gas += zero_bytes * silkworm::fee::kGTxDataZero;
gas += zero_bytes * silkworm::protocol::fee::kGTxDataZero;

return gas;
}
Expand Down
4 changes: 3 additions & 1 deletion tests/basic_evm_tester.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <silkworm/core/rlp/encode.hpp>
#include <silkworm/core/common/util.hpp>
#include <silkworm/core/execution/address.hpp>
#include <silkworm/core/chain/protocol_param.hpp>
#include <silkworm/core/protocol/param.hpp>

#include <secp256k1.h>

Expand Down Expand Up @@ -468,6 +468,8 @@ class basic_evm_tester : public evm_validating_tester
bool scan_gcstore(std::function<bool(gcstore)> visitor) const;
bool scan_account_code(std::function<bool(account_code)> visitor) const;
void scan_balances(std::function<bool(evm_test::vault_balance_row)> visitor) const;

intx::uint128 tx_data_cost(const silkworm::Transaction& txn) const;
};

inline constexpr intx::uint256 operator"" _wei(const char* s) { return intx::from_string<intx::uint256>(s); }
Expand Down

0 comments on commit 587589b

Please sign in to comment.