mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-03-28 15:13:09 +00:00
Fail test on request failed subcription
This commit is contained in:
parent
d3e57808e8
commit
971cf1bd38
@ -5,7 +5,7 @@ import pkg/codex/contracts/marketplace as mp
|
||||
import pkg/codex/periods
|
||||
import pkg/codex/utils/json
|
||||
from pkg/codex/utils import roundUp, divUp
|
||||
import ./multinodes
|
||||
import ./multinodes except Subscription
|
||||
import ../contracts/time
|
||||
import ../contracts/deployment
|
||||
|
||||
@ -18,6 +18,7 @@ template marketplacesuite*(name: string, body: untyped) =
|
||||
var period: uint64
|
||||
var periodicity: Periodicity
|
||||
var token {.inject, used.}: Erc20Token
|
||||
var failedSubscription: Subscription
|
||||
|
||||
proc getCurrentPeriod(): Future[Period] {.async.} =
|
||||
return periodicity.periodOf((await ethProvider.currentTime()).truncate(uint64))
|
||||
@ -110,4 +111,12 @@ template marketplacesuite*(name: string, body: untyped) =
|
||||
period = config.proofs.period
|
||||
periodicity = Periodicity(seconds: period)
|
||||
|
||||
proc onRequestFailed(eventResult: ?!RequestFailed) {.raises: [].} =
|
||||
fail()
|
||||
|
||||
failedSubscription = await marketplace.subscribe(RequestFailed, onRequestFailed)
|
||||
|
||||
teardown:
|
||||
await failedSubscription.unsubscribe()
|
||||
|
||||
body
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user