- use the `allowBlocksWithSameTimestamp` hardhat option
- remove block time gymnastics from marketplace tests
- fix erroneous implementation of requestEnd() which
surfaced because of the the improved tests
* Remove the mapping _probabilities
* Fix the slot propability calculation test by filling slot only instead of requiring proofs
* Remove custom errorr Proofs_InvalidProbability not used anymore
* changes reward => pricePerByte
* collateral => collateralPerByte
* updates tests
* introduces AskHelpers to compute price and collateral per slot
* adds public view function returning currentCollateral for the slot
* updates names for price and collateral
* uses pricePerSlotPerSecond in maxPriceHelper
* adds collateralPerSlot helper
* makes sure that the intended use of the <<currentCollateral>> view function is demonstrated in tests
* formatting
* fix comment
* mints more tokens so that it can be used with contracts tests in nim-codex
* Renaming <<collateral>> and <<reward>> to <<collateralPerByte>> and <<pricePerBytePerSecond>> respectively (merged in the meantime to the master)
This is not the right reason to be making this kind of change, but a very hard to debug symbol clash in codex for `config`. Changing this to `configuration` is the easiest way to fix the issue.
`SlotReservationsFull` event is emitted once a slot has reached its capacity for slot reservations (3 reservations at this time).
`SlotReservationsFull` event emists `requestId` and `slotIndex`.
* feat(slot-reservations): Allow slots to be reserved
Closes#175.
Allows reservation of slots, without an implementation of the expanding window.
- Add a function called `reserveSlot(address, SlotId)`, that allows three unique addresses per slot to be reserved, that returns bool if successful.
- Use `mapping(SlotId => EnumerableSet.AddressSet)`
- Return false if the address could not be added to the set (if `EnumerableSet.add` returns false)
- Add `canReserveSlot(address, SlotId)`
- Return `true` if set of reservations is less than 3 and the set doesn't already contain the address
- Return `true` otherwise (for now, later add in logic for checking the address is inside the expanding window)
- Call `canReserveSlot` from `reserveSlot` as a `require` or invariant
- Add `SlotReservations` configuration struct to the network-level config, with `maxReservations`