diff --git a/eth/common/eth_types.nim b/eth/common/eth_types.nim index e6e109e..b36bc9b 100644 --- a/eth/common/eth_types.nim +++ b/eth/common/eth_types.nim @@ -353,10 +353,10 @@ method getStateDb*(db: AbstractChainDB): TrieDatabaseRef {.base, gcsafe.} = method getCodeByHash*(db: AbstractChainDB, hash: KeccakHash): Blob {.base, gcsafe.} = notImplemented() -method getSetting*(db: AbstractChainDb, key: string): Bytes {.base, gcsafe.} = +method getSetting*(db: AbstractChainDB, key: string): Bytes {.base, gcsafe.} = notImplemented() -method setSetting*(db: AbstractChainDb, key: string, val: openarray[byte]) {.base, gcsafe.} = +method setSetting*(db: AbstractChainDB, key: string, val: openarray[byte]) {.base, gcsafe.} = notImplemented() method getHeaderProof*(db: AbstractChainDB, req: ProofRequest): Blob {.base, gcsafe.} = diff --git a/eth/common/state_accessors.nim b/eth/common/state_accessors.nim index 6871c82..504acad 100644 --- a/eth/common/state_accessors.nim +++ b/eth/common/state_accessors.nim @@ -12,13 +12,13 @@ proc getAccount*(db: TrieDatabaseRef, else: result = newAccount() -proc getContractCode*(chain: AbstractChainDb, req: ContractCodeRequest): Blob {.gcsafe.} = +proc getContractCode*(chain: AbstractChainDB, req: ContractCodeRequest): Blob {.gcsafe.} = let b = chain.getBlockHeader(req.blockHash) if b.hasData: let acc = getAccount(chain.getStateDb, b.stateRoot, req.key) result = chain.getCodeByHash(acc.codeHash) -proc getStorageNode*(chain: AbstractChainDb, hash: KeccakHash): Blob = +proc getStorageNode*(chain: AbstractChainDB, hash: KeccakHash): Blob = let db = chain.getStateDb return db.get(hash.data) # let trie = initSecureHexaryTrie(db, emptyRlpHash) # TODO emptyRlpHash is not correct here diff --git a/eth/p2p/blockchain_utils.nim b/eth/p2p/blockchain_utils.nim index 96b864e..ab30408 100644 --- a/eth/p2p/blockchain_utils.nim +++ b/eth/p2p/blockchain_utils.nim @@ -3,7 +3,7 @@ import # TODO: Perhaps we can move this to eth-common -proc getBlockHeaders*(db: AbstractChainDb, +proc getBlockHeaders*(db: AbstractChainDB, req: BlocksRequest): seq[BlockHeader] {.gcsafe.} = result = newSeqOfCap[BlockHeader](req.maxResults) @@ -17,7 +17,7 @@ proc getBlockHeaders*(db: AbstractChainDb, result.add foundBlock template fetcher*(fetcherName, fetchingFunc, InputType, ResultType: untyped) = - proc fetcherName*(db: AbstractChainDb, + proc fetcherName*(db: AbstractChainDB, lookups: openarray[InputType]): seq[ResultType] {.gcsafe.} = for lookup in lookups: let fetched = fetchingFunc(db, lookup) @@ -34,7 +34,7 @@ fetcher getReceipts, getReceipt, KeccakHash, Receipt fetcher getProofs, getProof, ProofRequest, Blob fetcher getHeaderProofs, getHeaderProof, ProofRequest, Blob -proc getHelperTrieProofs*(db: AbstractChainDb, +proc getHelperTrieProofs*(db: AbstractChainDB, reqs: openarray[HelperTrieProofRequest], outNodes: var seq[Blob], outAuxData: var seq[Blob]) = discard diff --git a/eth/p2p/mock_peers.nim b/eth/p2p/mock_peers.nim index 911f77d..c1939c6 100644 --- a/eth/p2p/mock_peers.nim +++ b/eth/p2p/mock_peers.nim @@ -18,7 +18,7 @@ type keys*: KeyPair address*: Address networkId*: uint - chain*: AbstractChainDb + chain*: AbstractChainDB clientId*: string waitForHello*: bool diff --git a/eth/p2p/rlpx_protocols/les/flow_control.nim b/eth/p2p/rlpx_protocols/les/flow_control.nim index 80cb282..382c9f4 100644 --- a/eth/p2p/rlpx_protocols/les/flow_control.nim +++ b/eth/p2p/rlpx_protocols/les/flow_control.nim @@ -92,7 +92,7 @@ proc persistMessageStats*(db: AbstractChainDB, proc loadMessageStats*(network: LesNetwork, les: ProtocolInfo, - db: AbstractChainDb): bool = + db: AbstractChainDB): bool = block readFromDB: if db == nil: break readFromDB @@ -262,7 +262,7 @@ proc delistFromFlowControl*(network: LesNetwork, peer: LesPeer) = proc initFlowControl*(network: LesNetwork, les: ProtocolInfo, maxReqCount, maxReqCostSum, reqCostTarget: int, - db: AbstractChainDb = nil) = + db: AbstractChainDB = nil) = network.rechargingRate = (rechargingScale * rechargingScale) / (100 * rechargingScale / reqCostTarget - rechargingScale) network.maxReqCount = maxReqCount