add minimal changes to get integration tests running

This commit is contained in:
gmega 2024-01-11 17:14:37 -03:00
parent 591895f225
commit 4019f35c76
No known key found for this signature in database
GPG Key ID: FFD8DAF00660270F
4 changed files with 13 additions and 9 deletions

View File

@ -25,5 +25,5 @@ template ethersuite*(name, body) =
body
export asynctest
export unittest
export ethers except `%`

View File

@ -28,7 +28,7 @@ proc setLogLevel*(client: CodexClient, level: string) =
let url = client.baseurl & "/debug/chronicles/loglevel?level=" & level
let headers = newHttpHeaders({"Content-Type": "text/plain"})
let response = client.http.request(url, httpMethod=HttpPost, headers=headers)
assert response.status == "200 OK"
assert response.status == "200 OK", response.status
proc upload*(client: CodexClient, contents: string): ?!Cid =
let response = client.http.post(client.baseurl & "/data", contents)

View File

@ -30,9 +30,11 @@ twonodessuite "Proving integration test", debug1=false, debug2=false:
# As we use in tests ethProvider.currentTime() which uses block timestamp this can lead to synchronization issues.
await ethProvider.advanceTime(1.u256)
proc waitUntilPurchaseIsStarted(proofProbability: uint64 = 3,
duration: uint64 = 100 * period,
expiry: uint64 = 30) {.async.} =
proc waitUntilPurchaseIsStarted(
proofProbability: uint64 = 3,
duration: uint64 = 100 * period,
expiry: uint64 = 30
) {.async: (handleException: true, raises: [AsyncExceptionError]).} =
discard client2.postAvailability(
size=0xFFFFF.u256,
duration=duration.u256,
@ -141,9 +143,11 @@ multinodesuite "Simulate invalid proofs",
let endOfPeriod = periodicity.periodEnd(currentPeriod)
await ethProvider.advanceTimeTo(endOfPeriod + 1)
proc waitUntilPurchaseIsStarted(proofProbability: uint64 = 1,
duration: uint64 = 12.periods,
expiry: uint64 = 4.periods) {.async.} =
proc waitUntilPurchaseIsStarted(
proofProbability: uint64 = 1,
duration: uint64 = 12.periods,
expiry: uint64 = 4.periods
) {.async: (handleException: true, raises: [AsyncExceptionError]).} =
if clients().len < 1 or providers().len < 1:
raiseAssert("must start at least one client and one ethProvider")

2
vendor/asynctest vendored

@ -1 +1 @@
Subproject commit 8e2f4e73b97123be0f0041c129942b32df23ecb1
Subproject commit d60ffb9792234986e14f88dcc21a15437d0ea212