Commit Graph

10 Commits

Author SHA1 Message Date
Eric Mastro 47da5c1625
[marketplace] sales state machine: use slotState
Use `slotState` instead of `requestState` for sales state machine.

[marketplace] clean up
2023-02-21 17:21:21 +11:00
Eric Mastro 03a87636e7
[marketplace] support slotIndex no longer optional
Previously, SalesAgent.slotIndex had been moved to not optional. However, there were still many places where optionality was assumed. This commit removes those assumuptions.
2023-02-14 13:47:53 +01:00
Mark Spanbroek b017359d13
[sales] make slotIndex non-optional 2023-02-14 13:47:52 +01:00
Mark Spanbroek 8a8e7aed70
[sales] fix: do not crash when fetching state fails 2023-02-14 13:47:52 +01:00
Mark Spanbroek 083e341592
[sales] cleanup 2023-02-14 13:47:52 +01:00
Eric Mastro 437036a9a6
[marketplace] align with contract changes
- getState / state > requestState
- getSlot > getRequestFromSlotId
- support MarketplaceConfig
- support slotState, remove unneeded Slot type
- collateral > config.collateral.initialAmount
- remove proofPeriod contract call
- Revert reason “Slot empty” > “Slot is free”
- getProofEnd > read SlotState

Tests for changes
2023-02-14 13:47:52 +01:00
Eric Mastro 19fe1b85e3
[marketplace] use requestId for mySlots 2023-02-14 13:47:51 +01:00
Eric Mastro 3db7b49537
[marketplace] handle slot filled by other host
Handle the case when in the downloading, proving, or filling states, that another host fills the slot.
2023-02-14 13:47:51 +01:00
Eric Mastro 0957c9adfa
PR comments
- add slotIndex to `SalesAgent` constructor
- remove `SalesAgent.init`
- rename `SalesAgent.init` to `start` and `SalesAgent.deinit` to `stop`.
- rename `SalesAgent. populateRequest` to `SalesAgent.retreiveRequest`.
- move availability removal to the downloading state. once availability is persisted to disk, it should survive node restarts.
-
2023-02-14 13:47:51 +01:00
Eric Mastro 67914249b6
[marketplace] move sale process to async state machine 2023-02-14 13:47:50 +01:00