mirror of https://github.com/status-im/nim-eth.git
Add CatchableErrors where needed because of db backends used
In nim-eth this will not fail, as they are base, not implemented methods. In for example Nimbus-eth1 it will.
This commit is contained in:
parent
90b4724492
commit
bcb58216d1
|
@ -373,7 +373,7 @@ method genesisHash*(db: AbstractChainDB): KeccakHash
|
||||||
notImplemented()
|
notImplemented()
|
||||||
|
|
||||||
method getBlockHeader*(db: AbstractChainDB, b: HashOrNum,
|
method getBlockHeader*(db: AbstractChainDB, b: HashOrNum,
|
||||||
output: var BlockHeader): bool {.base, gcsafe, raises: [Defect].} =
|
output: var BlockHeader): bool {.base, gcsafe, raises: [CatchableError, Defect].} =
|
||||||
notImplemented()
|
notImplemented()
|
||||||
|
|
||||||
proc getBlockHeader*(db: AbstractChainDB, hash: KeccakHash): BlockHeaderRef {.gcsafe.} =
|
proc getBlockHeader*(db: AbstractChainDB, hash: KeccakHash): BlockHeaderRef {.gcsafe.} =
|
||||||
|
@ -387,17 +387,17 @@ proc getBlockHeader*(db: AbstractChainDB, b: BlockNumber): BlockHeaderRef {.gcsa
|
||||||
return nil
|
return nil
|
||||||
|
|
||||||
method getBestBlockHeader*(self: AbstractChainDB): BlockHeader
|
method getBestBlockHeader*(self: AbstractChainDB): BlockHeader
|
||||||
{.base, gcsafe, raises: [Defect].} =
|
{.base, gcsafe, raises: [CatchableError, Defect].} =
|
||||||
notImplemented()
|
notImplemented()
|
||||||
|
|
||||||
method getSuccessorHeader*(db: AbstractChainDB, h: BlockHeader,
|
method getSuccessorHeader*(db: AbstractChainDB, h: BlockHeader,
|
||||||
output: var BlockHeader, skip = 0'u): bool
|
output: var BlockHeader, skip = 0'u): bool
|
||||||
{.base, gcsafe, raises: [Defect].} =
|
{.base, gcsafe, raises: [CatchableError, Defect].} =
|
||||||
notImplemented()
|
notImplemented()
|
||||||
|
|
||||||
method getAncestorHeader*(db: AbstractChainDB, h: BlockHeader,
|
method getAncestorHeader*(db: AbstractChainDB, h: BlockHeader,
|
||||||
output: var BlockHeader, skip = 0'u): bool
|
output: var BlockHeader, skip = 0'u): bool
|
||||||
{.base, gcsafe, raises: [Defect].} =
|
{.base, gcsafe, raises: [CatchableError, Defect].} =
|
||||||
notImplemented()
|
notImplemented()
|
||||||
|
|
||||||
method getBlockBody*(db: AbstractChainDB, blockHash: KeccakHash): BlockBodyRef
|
method getBlockBody*(db: AbstractChainDB, blockHash: KeccakHash): BlockBodyRef
|
||||||
|
|
|
@ -4,7 +4,7 @@ import
|
||||||
# TODO: Perhaps we can move this to eth-common
|
# TODO: Perhaps we can move this to eth-common
|
||||||
|
|
||||||
proc getBlockHeaders*(db: AbstractChainDB, req: BlocksRequest): seq[BlockHeader]
|
proc getBlockHeaders*(db: AbstractChainDB, req: BlocksRequest): seq[BlockHeader]
|
||||||
{.gcsafe, raises: [Defect].} =
|
{.gcsafe, raises: [CatchableError, Defect].} =
|
||||||
result = newSeqOfCap[BlockHeader](req.maxResults)
|
result = newSeqOfCap[BlockHeader](req.maxResults)
|
||||||
|
|
||||||
var foundBlock: BlockHeader
|
var foundBlock: BlockHeader
|
||||||
|
|
Loading…
Reference in New Issue