Hotfix: don't crash on web3 provider errors during initialization
This commit is contained in:
parent
6568e428b1
commit
883e18da81
|
@ -416,6 +416,7 @@ proc init*(T: type Eth1Monitor,
|
|||
var web3Url = web3Url
|
||||
fixupWeb3Urls web3Url
|
||||
|
||||
try:
|
||||
let dataProviderRes = await Web3DataProvider.new(depositContractAddress, web3Url)
|
||||
if dataProviderRes.isErr:
|
||||
return err(dataProviderRes.error)
|
||||
|
@ -441,6 +442,8 @@ proc init*(T: type Eth1Monitor,
|
|||
depositContractDeployedAt: depositContractDeployedAt,
|
||||
dataProvider: dataProvider,
|
||||
eth1Progress: newAsyncEvent())
|
||||
except CatchableError as err:
|
||||
return err("Failed to initialize the Eth1 monitor")
|
||||
|
||||
proc allDepositsUpTo(m: Eth1Monitor, totalDeposits: uint64): seq[DepositData] =
|
||||
for i in 0'u64 ..< totalDeposits:
|
||||
|
|
Loading…
Reference in New Issue