mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-05-20 15:40:48 -04:00
swap_setup
instead of spot_price
and execution_setup
Having `spot_price` and `execution_setup` as separate protocols did not bring any advantages, but was problematic because we had to ensure that `execution_setup` would be triggered after `spot_price`. Because of this dependency it is better to combine the protocols into one. Combining the protocols also allows a refactoring to get rid of the `libp2p-async-await` dependency. Alice always listens for the `swap_setup` protocol. When Bob opens a substream on that protocol the spot price is communicated, and then all execution setup messages (swap-id and signature exchange).
This commit is contained in:
parent
ada5acb2b5
commit
818147a629
30 changed files with 1063 additions and 1563 deletions
|
@ -46,7 +46,7 @@ impl From<BobState> for Bob {
|
|||
fn from(bob_state: BobState) -> Self {
|
||||
match bob_state {
|
||||
BobState::Started { btc_amount } => Bob::Started { btc_amount },
|
||||
BobState::ExecutionSetupDone(state2) => Bob::ExecutionSetupDone { state2 },
|
||||
BobState::SwapSetupCompleted(state2) => Bob::ExecutionSetupDone { state2 },
|
||||
BobState::BtcLocked(state3) => Bob::BtcLocked { state3 },
|
||||
BobState::XmrLockProofReceived {
|
||||
state,
|
||||
|
@ -78,7 +78,7 @@ impl From<Bob> for BobState {
|
|||
fn from(db_state: Bob) -> Self {
|
||||
match db_state {
|
||||
Bob::Started { btc_amount } => BobState::Started { btc_amount },
|
||||
Bob::ExecutionSetupDone { state2 } => BobState::ExecutionSetupDone(state2),
|
||||
Bob::ExecutionSetupDone { state2 } => BobState::SwapSetupCompleted(state2),
|
||||
Bob::BtcLocked { state3 } => BobState::BtcLocked(state3),
|
||||
Bob::XmrLockProofReceived {
|
||||
state,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue