simplify getRequest
This commit is contained in:
parent
eb14ca6166
commit
ae9467b780
|
@ -37,11 +37,7 @@ method requestStorage(market: OnChainMarket,
|
||||||
method getRequest(market: OnChainMarket,
|
method getRequest(market: OnChainMarket,
|
||||||
id: RequestId): Future[?StorageRequest] {.async.} =
|
id: RequestId): Future[?StorageRequest] {.async.} =
|
||||||
try:
|
try:
|
||||||
let request = await market.contract.getRequest(id)
|
return some await market.contract.getRequest(id)
|
||||||
if request != StorageRequest.default:
|
|
||||||
return some request
|
|
||||||
else:
|
|
||||||
return none StorageRequest
|
|
||||||
except ValueError:
|
except ValueError:
|
||||||
# Unknown request
|
# Unknown request
|
||||||
return none StorageRequest
|
return none StorageRequest
|
||||||
|
|
Loading…
Reference in New Issue