mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-02-04 00:05:22 +00:00
Update memDB/chain use with eth_trie changes
This commit is contained in:
parent
eceaa58ebb
commit
e5551bb3f7
@ -7,7 +7,7 @@
|
||||
|
||||
import
|
||||
unittest, ../nimbus/vm/precompiles, json, byteutils, test_helpers, ospaths, tables,
|
||||
strformat, strutils, eth_trie/[types, memdb], eth_common, ../nimbus/db/[db_chain, state_db],
|
||||
strformat, strutils, eth_trie/db, eth_common, ../nimbus/db/[db_chain, state_db],
|
||||
../nimbus/[constants, vm_types, vm_state], ../nimbus/vm/[computation, message], macros
|
||||
|
||||
proc initAddress(i: byte): EthAddress = result[19] = i
|
||||
@ -23,7 +23,6 @@ template doTest(fixture: JsonNode, address: byte, action: untyped): untyped =
|
||||
var
|
||||
dataStr = test["input"].getStr
|
||||
data = if dataStr.len > 0: dataStr.hexToSeqByte else: @[]
|
||||
memDb = newMemDB()
|
||||
vmState = newBaseVMState(header, newBaseChainDB(newMemoryDb()))
|
||||
gas = 1_000_000.GasInt
|
||||
gasPrice = 1.GasInt
|
||||
|
@ -5,7 +5,8 @@ import
|
||||
../nimbus/constants,
|
||||
../nimbus/nimbus/[vm_state, config],
|
||||
../nimbus/db/[state_db, db_chain], eth_common, byteutils,
|
||||
eth_trie/[memDb, types],
|
||||
../nimbus/p2p/chain,
|
||||
eth_trie/db,
|
||||
eth_p2p, eth_keys
|
||||
import rpcclient/test_hexstrings
|
||||
|
||||
@ -42,12 +43,12 @@ proc doTests =
|
||||
# TODO: Include other transports such as Http
|
||||
var ethNode = setupEthNode()
|
||||
let
|
||||
emptyRlpHash = keccak256.digest(rlp.encode("").toOpenArray)
|
||||
emptyRlpHash = keccak256.digest(rlp.encode(""))
|
||||
header = BlockHeader(stateRoot: emptyRlpHash)
|
||||
var
|
||||
chain = newBaseChainDB(newMemoryDb())
|
||||
state = newBaseVMState(header, chain)
|
||||
ethNode.chain = chain
|
||||
ethNode.chain = newChain(chain)
|
||||
|
||||
let
|
||||
balance = 100.u256
|
||||
|
Loading…
x
Reference in New Issue
Block a user