mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-12 13:24:21 +00:00
Avoid raw Exception raises by moving confutils config load (#1461)
This commit is contained in:
parent
c2fc46a99a
commit
77135e7001
@ -65,7 +65,7 @@
|
||||
import
|
||||
std/[os, strutils, options],
|
||||
web3/ethtypes,
|
||||
chronicles, chronos,
|
||||
chronicles, chronos, confutils,
|
||||
eth/[keys, rlp], eth/[trie, trie/db],
|
||||
# Need to rename this because of web3 ethtypes and ambigious indentifier mess
|
||||
# for `BlockHeader`.
|
||||
@ -155,13 +155,7 @@ proc asPortalBlockData*(
|
||||
|
||||
(hash, headerWithProof, body)
|
||||
|
||||
# TODO Find what can throw exception
|
||||
proc run() {.raises: [Exception].} =
|
||||
{.pop.}
|
||||
var config = makeBannerAndConfig(
|
||||
"Nimbus beacon chain bridge", BeaconBridgeConf)
|
||||
{.push raises: [].}
|
||||
|
||||
proc run(config: BeaconBridgeConf) {.raises: [CatchableError].} =
|
||||
# Required as both Eth2Node and LightClient requires correct config type
|
||||
var lcConfig = config.asLightClientConf()
|
||||
|
||||
@ -388,4 +382,9 @@ proc run() {.raises: [Exception].} =
|
||||
poll()
|
||||
|
||||
when isMainModule:
|
||||
run()
|
||||
{.pop.}
|
||||
var config = makeBannerAndConfig(
|
||||
"Nimbus beacon chain bridge", BeaconBridgeConf)
|
||||
{.push raises: [].}
|
||||
|
||||
run(config)
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
import
|
||||
std/[os, strutils],
|
||||
chronicles, chronicles/chronos_tools, chronos,
|
||||
chronicles, chronicles/chronos_tools, chronos, confutils,
|
||||
eth/keys,
|
||||
json_rpc/rpcproxy,
|
||||
beacon_chain/eth1/eth1_monitor,
|
||||
@ -40,13 +40,7 @@ func getConfiguredChainId(networkMetadata: Eth2NetworkMetadata): Quantity =
|
||||
else:
|
||||
return networkMetadata.cfg.DEPOSIT_CHAIN_ID.Quantity
|
||||
|
||||
# TODO Find what can throw exception
|
||||
proc run() {.raises: [Exception].} =
|
||||
{.pop.}
|
||||
var config = makeBannerAndConfig(
|
||||
"Nimbus verified proxy " & fullVersionStr, VerifiedProxyConf)
|
||||
{.push raises: [].}
|
||||
|
||||
proc run(config: VerifiedProxyConf) {.raises: [CatchableError].} =
|
||||
# Required as both Eth2Node and LightClient requires correct config type
|
||||
var lcConfig = config.asLightClientConf()
|
||||
|
||||
@ -246,4 +240,9 @@ proc run() {.raises: [Exception].} =
|
||||
poll()
|
||||
|
||||
when isMainModule:
|
||||
run()
|
||||
{.pop.}
|
||||
var config = makeBannerAndConfig(
|
||||
"Nimbus verified proxy " & fullVersionStr, VerifiedProxyConf)
|
||||
{.push raises: [].}
|
||||
|
||||
run(config)
|
||||
|
Loading…
x
Reference in New Issue
Block a user