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()
|
||||
|
||||
method getBlockHeader*(db: AbstractChainDB, b: HashOrNum,
|
||||
output: var BlockHeader): bool {.base, gcsafe, raises: [Defect].} =
|
||||
output: var BlockHeader): bool {.base, gcsafe, raises: [CatchableError, Defect].} =
|
||||
notImplemented()
|
||||
|
||||
proc getBlockHeader*(db: AbstractChainDB, hash: KeccakHash): BlockHeaderRef {.gcsafe.} =
|
||||
|
@ -387,17 +387,17 @@ proc getBlockHeader*(db: AbstractChainDB, b: BlockNumber): BlockHeaderRef {.gcsa
|
|||
return nil
|
||||
|
||||
method getBestBlockHeader*(self: AbstractChainDB): BlockHeader
|
||||
{.base, gcsafe, raises: [Defect].} =
|
||||
{.base, gcsafe, raises: [CatchableError, Defect].} =
|
||||
notImplemented()
|
||||
|
||||
method getSuccessorHeader*(db: AbstractChainDB, h: BlockHeader,
|
||||
output: var BlockHeader, skip = 0'u): bool
|
||||
{.base, gcsafe, raises: [Defect].} =
|
||||
{.base, gcsafe, raises: [CatchableError, Defect].} =
|
||||
notImplemented()
|
||||
|
||||
method getAncestorHeader*(db: AbstractChainDB, h: BlockHeader,
|
||||
output: var BlockHeader, skip = 0'u): bool
|
||||
{.base, gcsafe, raises: [Defect].} =
|
||||
{.base, gcsafe, raises: [CatchableError, Defect].} =
|
||||
notImplemented()
|
||||
|
||||
method getBlockBody*(db: AbstractChainDB, blockHash: KeccakHash): BlockBodyRef
|
||||
|
|
|
@ -4,7 +4,7 @@ import
|
|||
# TODO: Perhaps we can move this to eth-common
|
||||
|
||||
proc getBlockHeaders*(db: AbstractChainDB, req: BlocksRequest): seq[BlockHeader]
|
||||
{.gcsafe, raises: [Defect].} =
|
||||
{.gcsafe, raises: [CatchableError, Defect].} =
|
||||
result = newSeqOfCap[BlockHeader](req.maxResults)
|
||||
|
||||
var foundBlock: BlockHeader
|
||||
|
|
Loading…
Reference in New Issue