From daaf0f2a202439c6b8d01e48924135059bd50474 Mon Sep 17 00:00:00 2001 From: andri lim Date: Mon, 25 Nov 2024 22:37:57 +0700 Subject: [PATCH] Remove trie_defs imports (#2872) --- nimbus/common/common.nim | 1 - tests/test_generalstate_json.nim | 3 +-- tests/test_getproof_json.nim | 2 +- tools/evmstate/evmstate.nim | 1 - tools/evmstate/helpers.nim | 5 ++--- 5 files changed, 4 insertions(+), 8 deletions(-) diff --git a/nimbus/common/common.nim b/nimbus/common/common.nim index 3114620c21..5b93bca7f3 100644 --- a/nimbus/common/common.nim +++ b/nimbus/common/common.nim @@ -11,7 +11,6 @@ import chronicles, - eth/trie/trie_defs, ../core/casper, ../db/[core_db, ledger, storage_types], ../utils/[utils, ec_recover], diff --git a/tests/test_generalstate_json.nim b/tests/test_generalstate_json.nim index 0d7c75c64d..afa470921c 100644 --- a/tests/test_generalstate_json.nim +++ b/tests/test_generalstate_json.nim @@ -19,7 +19,6 @@ import ../tools/common/helpers as chp, ../tools/evmstate/helpers, ../tools/common/state_clearing, - eth/trie/trie_defs, eth/common/transaction_utils, unittest2, stew/byteutils, @@ -79,7 +78,7 @@ proc dumpDebugData(ctx: TestCtx, vmState: BaseVMState, gasUsed: GasInt, success: proc testFixtureIndexes(ctx: var TestCtx, testStatusIMPL: var TestStatus) = let com = CommonRef.new(newCoreDbRef DefaultDbMemory, ctx.chainConfig) - parent = Header(stateRoot: emptyRlpHash) + parent = Header(stateRoot: emptyRoot) tracer = if ctx.trace: newLegacyTracer({}) else: diff --git a/tests/test_getproof_json.nim b/tests/test_getproof_json.nim index a6d6c8b6bf..dc26ca8265 100644 --- a/tests/test_getproof_json.nim +++ b/tests/test_getproof_json.nim @@ -12,7 +12,7 @@ import web3/eth_api, nimcrypto/[keccak, hash], eth/common/[keys, eth_types_rlp], - eth/[rlp, trie/trie_defs, trie/hexary_proof_verification], + eth/[rlp, trie/hexary_proof_verification], ../nimbus/db/[ledger, core_db], ../nimbus/common/chain_config, ../nimbus/rpc/server_api diff --git a/tools/evmstate/evmstate.nim b/tools/evmstate/evmstate.nim index d01a9ac0c4..991c082da2 100644 --- a/tools/evmstate/evmstate.nim +++ b/tools/evmstate/evmstate.nim @@ -16,7 +16,6 @@ import stew/byteutils, results, stint, - eth/trie/[trie_defs], ../../nimbus/[evm/types, evm/state], ../../nimbus/db/ledger, ../../nimbus/transaction, diff --git a/tools/evmstate/helpers.nim b/tools/evmstate/helpers.nim index ba2f8eeace..756b306224 100644 --- a/tools/evmstate/helpers.nim +++ b/tools/evmstate/helpers.nim @@ -13,7 +13,6 @@ import eth/common/keys, eth/common/headers, eth/common/transactions, - eth/trie/trie_defs, stint, stew/byteutils, ../../nimbus/transaction, @@ -113,7 +112,7 @@ proc parseHeader*(n: JsonNode): Header = number : required(BlockNumber, "currentNumber"), gasLimit : required(GasInt, "currentGasLimit"), timestamp : required(EthTime, "currentTimestamp"), - stateRoot : emptyRlpHash, + stateRoot : emptyRoot, mixHash : omitZero(Bytes32, "currentRandom"), baseFeePerGas : optional(UInt256, "currentBaseFee"), withdrawalsRoot: optional(Hash32, "currentWithdrawalsRoot"), @@ -123,7 +122,7 @@ proc parseHeader*(n: JsonNode): Header = proc parseParentHeader*(n: JsonNode): Header = Header( - stateRoot: emptyRlpHash, + stateRoot: emptyRoot, excessBlobGas: optional(uint64, "parentExcessBlobGas"), blobGasUsed: optional(uint64, "parentBlobGasUsed"), )