[marketplace] Catch slot empty, return default values
This commit is contained in:
parent
9d218c88a5
commit
8dd110765f
|
@ -24,15 +24,24 @@ method periodicity*(proofs: OnChainProofs): Future[Periodicity] {.async.} =
|
||||||
|
|
||||||
method isProofRequired*(proofs: OnChainProofs,
|
method isProofRequired*(proofs: OnChainProofs,
|
||||||
id: SlotId): Future[bool] {.async.} =
|
id: SlotId): Future[bool] {.async.} =
|
||||||
|
try:
|
||||||
return await proofs.storage.isProofRequired(id)
|
return await proofs.storage.isProofRequired(id)
|
||||||
|
except ValueError:
|
||||||
|
return false
|
||||||
|
|
||||||
method willProofBeRequired*(proofs: OnChainProofs,
|
method willProofBeRequired*(proofs: OnChainProofs,
|
||||||
id: SlotId): Future[bool] {.async.} =
|
id: SlotId): Future[bool] {.async.} =
|
||||||
|
try:
|
||||||
return await proofs.storage.willProofBeRequired(id)
|
return await proofs.storage.willProofBeRequired(id)
|
||||||
|
except ValueError:
|
||||||
|
return false
|
||||||
|
|
||||||
method getProofEnd*(proofs: OnChainProofs,
|
method getProofEnd*(proofs: OnChainProofs,
|
||||||
id: SlotId): Future[UInt256] {.async.} =
|
id: SlotId): Future[UInt256] {.async.} =
|
||||||
|
try:
|
||||||
return await proofs.storage.proofEnd(id)
|
return await proofs.storage.proofEnd(id)
|
||||||
|
except ValueError:
|
||||||
|
return 0.u256
|
||||||
|
|
||||||
method submitProof*(proofs: OnChainProofs,
|
method submitProof*(proofs: OnChainProofs,
|
||||||
id: SlotId,
|
id: SlotId,
|
||||||
|
|
Loading…
Reference in New Issue