mirror of
https://github.com/status-im/nim-codex.git
synced 2025-01-10 02:45:59 +00:00
4ffe7b8e06
* [maintenance] speedup integration test * [rest api] add proofProbability parameter to storage requests * [integration] negotiation test ends when contract starts * [integration] reusable 2 node setup for tests * [integration] introduce CodexClient for tests * [node] submit storage proofs when required * [contracts] Add Slot type * [proving] replace onProofRequired & submitProof with onProve Removes duplication between Sales.onProve() and Proving.onProofRequired()
26 lines
1.0 KiB
Nim
26 lines
1.0 KiB
Nim
import pkg/upraises
|
|
import ../market
|
|
import ../clock
|
|
import ../proving
|
|
import ./availability
|
|
|
|
type
|
|
SalesContext* = ref object
|
|
market*: Market
|
|
clock*: Clock
|
|
onStore*: ?OnStore
|
|
onClear*: ?OnClear
|
|
onSale*: ?OnSale
|
|
onSaleErrored*: ?OnSaleErrored
|
|
proving*: Proving
|
|
OnStore* = proc(request: StorageRequest,
|
|
slot: UInt256,
|
|
availability: ?Availability): Future[void] {.gcsafe, upraises: [].}
|
|
OnClear* = proc(availability: ?Availability,# TODO: when availability changes introduced, make availability non-optional (if we need to keep it at all)
|
|
request: StorageRequest,
|
|
slotIndex: UInt256) {.gcsafe, upraises: [].}
|
|
OnSale* = proc(availability: ?Availability, # TODO: when availability changes introduced, make availability non-optional (if we need to keep it at all)
|
|
request: StorageRequest,
|
|
slotIndex: UInt256) {.gcsafe, upraises: [].}
|
|
OnSaleErrored* = proc(availability: Availability) {.gcsafe, upraises: [].}
|