This allows players and the market maker to transact network sockets,
or other transport channels, by passing nonces, sigmaps, etc, back
and forth to each other. It also allows parties to store their signed
contract data locally, and enforce the contract even after a restart.
This test validates the basic spending paths are enforceable.
It covers the split TX, followed by three different resolutions
for each individual payout contract. We test to confirm:
- a player can claim winnings using their ticket preimage
- the market maker can reclaim winnings using the payout preimage
- the market maker can reclaim winnings after the timeout
This allows the market maker to cooperatively close individual payout
contracts with specific winners, if some of an outcome's winners
cooperate but others do not.
We were using btrees indexed by players, which required each
btree to store the player in memory. This was inefficient.
Instead, we now index by usize, which is a player index in the
sorted set of players in ContractParameters.
These methods allow players and the market maker to execute the final
stages of a Ticketed DLC, including the forceful sellback TX, forceful
win transaction, and forceful reclaim transactions.
Each player only cares about the signatures which are needed
to enforce outcomes in which they receive money. Other outcomes
are entirely optional. The market maker must verify all signatures.
This adds additional states to the SigningSession state machine
which encapsulate the 2nd round of signing, and the final state
after signing is completed. Once all signatures have been received,
the Ticketed DLC is active and enforceable. Players can begin
buying ticket preimages from the market maker.
This is my first go at a higher level API which signers will
use to construct and sign the numerous transactions needed
for executing a Ticketed DLC. It revolves around the
SigningSession struct type, which has an API constrainted by
its current state.