Commit Graph

19 Commits

Author SHA1 Message Date
Mark Spanbroek 33614ee218 Calculate public inputs for ZK proof verificition 2024-01-25 13:08:10 +01:00
Mark Spanbroek db124ddbd9 Re-arrange marketplace constructor parameters
first configuration, then contracts that we depend on
2024-01-25 13:08:10 +01:00
Adam Uhlíř 0d9b67bb31 feat: verifier integration 2024-01-25 13:08:10 +01:00
Adam Uhlíř dfdbd16d5b
feat: collateral per slot (#44) 2023-03-08 12:02:34 +01:00
Mark Spanbroek b62eeb564a [marketplace] test & fix slotState() 2023-01-23 15:10:23 +01:00
Mark Spanbroek ae70fd7c6f [marketplace] introduce MarketplaceConfiguration struct
Container for all configuration values, replaces separate
constructor parameters and getters.
2023-01-23 15:10:23 +01:00
Mark Spanbroek 8c6891f1e2 [marketplace] slotIsNotFree() modifier
Replaces _slot getter
2023-01-23 15:10:23 +01:00
Mark Spanbroek 1316682a6f [marketplace] remove slotMustAcceptProofs modifier
Replaced by checks on slot state
2023-01-23 15:10:23 +01:00
Mark Spanbroek e496ac3550 [marketplace] remove _isCancelled and _isFinished 2023-01-23 15:10:23 +01:00
Mark Spanbroek 9aa4773392 [marketplace] remove unused _isSlotCancelled() 2023-01-23 15:10:23 +01:00
Mark Spanbroek 6ea2b77a8f [Storage] Move markProofAsMissing() to Marketplace 2023-01-10 12:15:22 +01:00
Mark Spanbroek 6c52f60381 [marketplace] Formatting 2022-12-22 10:29:06 +01:00
Mark Spanbroek 6e0dfdf7db [marketplace] Rename _freeSlot() -> _forciblyFreeSlot() 2022-12-22 10:29:06 +01:00
Eric Mastro cfb70897f8 [marketplace] alias bytes32 types
`RequestId`, `SlotId`, `LockId`, `ProofId`, `EndId` types were created to avoid confusion and enforce compiler restrictions.
2022-10-25 12:47:50 +11:00
Eric Mastro 321132b6fa clean up tests
1. Replace all instances of `now()` with `await currentTime()` to get a more accurate representation of time from the block timestamp. Update examples.js to be async.
2. Move `RequestState` to `marketplace.js`
3. Delete `TestStorage` as `slashAmount` function no longer needed.
2022-10-25 12:38:19 +11:00
Eric Mastro ad040cfee6 [marketplace] extend proof ending
Allow proof ending to be extending once a contract is started, so that all filled slots share an ending time that is equal to the contract end time. Added tests.

Add a mapping for proof id to endId so that proof expectations can be extended for all proofs that share a given endId.

Add function modifiers that require the request state to allow proofs, with accompanying tests.

General clean up of each function’s request state context, with accompanying tests.

General clean up of all tests, including state change “wait” functions and normalising the time advancement functions.
2022-10-25 12:38:19 +11:00
Eric Mastro 087c13a7fc update fillSlot and freeSlot state requirements
`fillSlot` and `freeSlot` must both be in a state of New or Started and not Cancelled (Finished to be added later).

Update tests to support the above.
2022-09-21 20:52:44 +10:00
Eric Mastro 9f8affdcaa [marketplace] Add tests for freeing a slot 2022-09-21 20:52:44 +10:00
Eric Mastro 716b864f02 [marketplace] update state getter
Update `Marketplace.state` getter to to take `isCancelled` into account. This state can then be used internally and externally.

Add checks to `proofEnd`, `isProofRequired`, `willProofBeRequired`, and `getChallenge` that understands if the request is in a state to accept proofs. If not, return other values.

Add `slotMustAcceptProofs` modifier, originally introduced in a later PR, which requires the request to be in state of the request accepting proofs.

Add tests for all the above.
2022-09-20 15:59:03 +10:00