* get request from slot id
- Add public function to get request from slot id.
- Add chai test assertion that compares requests. Usage: `expect(await marketplace.getRequestFromSlotId(slotId(slot))).to.be.request(request)`
This is used when restoring active sales, and a node calls `mySlots`, then iterates the slots and needs originating request details.
* merge upstream changes
Rationale: it was already a very thin wrapper
around Marketplace, and now that its remaining
functionality has been moved to Proofs and
Marketplace, we no longer need it.
Rationale: in practice, a ProofId was always a slot id, and
an EndId was always a request id. Now that the definitons
of SlotId and RequestId are separated from the Marketplace,
we can import and use them.
- Marketplace tests for requestsForHost, and additional tests for myRequests and mySlots
- Added Utils lib with tests
- Added additional Bytes32AddressSetMap.keys expectations
Reinstate the index mapping for `activeSlots`, however with a modified data structure. The main difference comes from a change in `mySlots`: it now requires a `RequestId` as a parameter (which can be obtained using `myRequests`. This allowed for the `activeSlots` mapping to be keyed on `RequestId`, which gives a mapping of `ActiveSlotId => EnumerableSet.Bytes32`. `ActiveSlotId` is a keccak hash of `address + activeSlotIdx`, which not only allows retrieval of all active slot ids per request, but also allows clearing of all active slot ids for a request by incrementing the `activeSlotIdx`.
```
requestId => [ keccak(address + activeSlotIdx) => EnumerableSet.Bytes32 ]
```
Instead, iterate all active slots and remove them individually, only if they are part of a specific request. This is only for the case of request failure.
Allow for clearing of active slots by host, by incrementing an mapping index. The new index points to a fresh instance of EnumerableSet, effectively wiping it clean.
There may be cases where the the request end is not accurate as the state of the request hasn’t yet been updated. For example, when a request is cancelled, the request end would not have been updated to be in the past, and would still be set for the end of the request (which could be in the future).