remove a few obsolete raises pops (#2654)

This commit is contained in:
Jacek Sieka 2021-06-16 14:45:05 +02:00 committed by GitHub
parent 96c489bb3d
commit a5711ecf18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 9 deletions

View File

@ -770,8 +770,6 @@ template getBlockProposalData*(m: Eth1Monitor,
finalizedStateDepositIndex: uint64): BlockProposalEth1Data =
getBlockProposalData(m.eth1Chain, state, finalizedEth1Data, finalizedStateDepositIndex)
{.pop.}
proc new(T: type Web3DataProvider,
depositContractAddress: Eth1Address,
web3Url: string): Future[Result[Web3DataProviderRef, string]] {.async.} =

View File

@ -183,8 +183,6 @@ proc checkForPotentialDoppelganger(
attestation = shortLog(attestation)
quit QuitFailure
{.pop.} # async can raise anything
proc attestationValidator*(
self: ref Eth2Processor,
attestation: Attestation,

View File

@ -199,9 +199,7 @@ const
pyrmontMetadata* = eth2testnet "shared/pyrmont"
praterMetadata* = eth2testnet "shared/prater"
{.pop.} # the following pocedures raise more than just `Defect`
proc getMetadataForNetwork*(networkName: string): Eth2NetworkMetadata =
proc getMetadataForNetwork*(networkName: string): Eth2NetworkMetadata {.raises: [Defect, IOError].} =
var
metadata = case toLowerAscii(networkName)
of "mainnet":
@ -229,10 +227,12 @@ proc getMetadataForNetwork*(networkName: string): Eth2NetworkMetadata =
metadata.genesisData = readFile(metadata.genesisDataPath)
return metadata
proc getRuntimePresetForNetwork*(eth2Network: Option[string]): RuntimePreset =
proc getRuntimePresetForNetwork*(
eth2Network: Option[string]): RuntimePreset {.raises: [Defect, IOError].} =
if eth2Network.isSome:
return getMetadataForNetwork(eth2Network.get).runtimePreset
return defaultRuntimePreset
proc extractGenesisValidatorRootFromSnapshop*(snapshot: string): Eth2Digest =
proc extractGenesisValidatorRootFromSnapshop*(
snapshot: string): Eth2Digest {.raises: [Defect, IOError, SszError].} =
sszMount(snapshot, BeaconState).genesis_validators_root[]