From 2db0131fa409a2f0dce038a0a8ab69c0e5b739c4 Mon Sep 17 00:00:00 2001 From: Eric Mastro Date: Fri, 26 Aug 2022 13:42:01 +1000 Subject: [PATCH] [fix] fix tests --- tests/codex/helpers/mockproofs.nim | 14 +++++--------- tests/codex/testproving.nim | 2 +- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/tests/codex/helpers/mockproofs.nim b/tests/codex/helpers/mockproofs.nim index cb73f786..13966f79 100644 --- a/tests/codex/helpers/mockproofs.nim +++ b/tests/codex/helpers/mockproofs.nim @@ -7,7 +7,7 @@ import pkg/codex/storageproofs type MockProofs* = ref object of Proofs periodicity: Periodicity - cancelledRequests: HashSet[SlotId] + cancelledSlots: HashSet[SlotId] proofsRequired: HashSet[SlotId] proofsToBeRequired: HashSet[SlotId] proofEnds: Table[SlotId, UInt256] @@ -33,19 +33,15 @@ proc setProofRequired*(mock: MockProofs, id: SlotId, required: bool) = else: mock.proofsRequired.excl(id) -proc setCancelled*(mock: MockProofs, id: SlotId, required: bool) = +proc setSlotCancelled*(mock: MockProofs, id: SlotId, required: bool) = if required: - mock.cancelledRequests.incl(id) + mock.cancelledSlots.incl(id) else: - mock.cancelledRequests.excl(id) - -method isCancelled*(mock: MockProofs, - id: RequestId): Future[bool] {.async.} = - return mock.cancelledRequests.contains(id) + mock.cancelledSlots.excl(id) method isSlotCancelled*(mock: MockProofs, id: SlotId): Future[bool] {.async.} = - return mock.cancelledRequests.contains(id) + return mock.cancelledSlots.contains(id) method isProofRequired*(mock: MockProofs, id: SlotId): Future[bool] {.async.} = diff --git a/tests/codex/testproving.nim b/tests/codex/testproving.nim index a24d8263..6ecd3dfe 100644 --- a/tests/codex/testproving.nim +++ b/tests/codex/testproving.nim @@ -101,7 +101,7 @@ suite "Proving": proofs.setProofRequired(id, true) await proofs.advanceToNextPeriod() proving.onProofRequired = onProofRequired - proofs.setCancelled(id, true) + proofs.setSlotCancelled(id, true) await proofs.advanceToNextPeriod() check not proving.slots.contains(id) check not called