mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-05-22 03:09:43 +00:00
catch contract errors to return bool
# Conflicts: # codex/contracts/proofs.nim # vendor/nim-ethers
This commit is contained in:
parent
ae9467b780
commit
dab65eb6bd
@ -26,15 +26,19 @@ method isProofRequired*(proofs: OnChainProofs,
|
|||||||
id: SlotId): Future[bool] {.async.} =
|
id: SlotId): Future[bool] {.async.} =
|
||||||
try:
|
try:
|
||||||
return await proofs.storage.isProofRequired(id)
|
return await proofs.storage.isProofRequired(id)
|
||||||
except ValueError:
|
except JsonRpcProviderError as e:
|
||||||
return false
|
if e.revertReason == "Slot empty":
|
||||||
|
return false
|
||||||
|
raise e
|
||||||
|
|
||||||
method willProofBeRequired*(proofs: OnChainProofs,
|
method willProofBeRequired*(proofs: OnChainProofs,
|
||||||
id: SlotId): Future[bool] {.async.} =
|
id: SlotId): Future[bool] {.async.} =
|
||||||
try:
|
try:
|
||||||
return await proofs.storage.willProofBeRequired(id)
|
return await proofs.storage.willProofBeRequired(id)
|
||||||
except ValueError:
|
except JsonRpcProviderError:
|
||||||
return false
|
if e.revertReason == "Slot empty":
|
||||||
|
return false
|
||||||
|
raise e
|
||||||
|
|
||||||
method getProofEnd*(proofs: OnChainProofs,
|
method getProofEnd*(proofs: OnChainProofs,
|
||||||
id: SlotId): Future[UInt256] {.async.} =
|
id: SlotId): Future[UInt256] {.async.} =
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user