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