From e66e84085b0211bd2c5e43056c93913aedee7fa0 Mon Sep 17 00:00:00 2001 From: Daniel Karzel Date: Fri, 26 Feb 2021 16:02:44 +1100 Subject: [PATCH] Rename Bob's Behavior Failure to CommunicationError Failure does not express what the error represents. It is only used for communication errors for quote requests, receiving the XMR transfer proof and sending the encryption signature. --- swap/src/protocol/bob.rs | 8 ++++---- swap/src/protocol/bob/event_loop.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/swap/src/protocol/bob.rs b/swap/src/protocol/bob.rs index 7117365b..5ca668bd 100644 --- a/swap/src/protocol/bob.rs +++ b/swap/src/protocol/bob.rs @@ -185,7 +185,7 @@ pub enum OutEvent { }, EncryptedSignatureAcknowledged, ResponseSent, // Same variant is used for all messages as no processing is done - Failure(Error), + CommunicationError(Error), } impl From for OutEvent { @@ -203,7 +203,7 @@ impl From for OutEvent { use quote_request::OutEvent::*; match event { MsgReceived(quote_response) => OutEvent::QuoteResponse(quote_response), - Failure(err) => OutEvent::Failure(err.context("Failure with Quote Request")), + Failure(err) => OutEvent::CommunicationError(err.context("Failure with Quote Request")), } } } @@ -225,7 +225,7 @@ impl From for OutEvent { channel, }, AckSent => OutEvent::ResponseSent, - Failure(err) => OutEvent::Failure(err.context("Failure with Transfer Proof")), + Failure(err) => OutEvent::CommunicationError(err.context("Failure with Transfer Proof")), } } } @@ -235,7 +235,7 @@ impl From for OutEvent { use encrypted_signature::OutEvent::*; match event { Acknowledged => OutEvent::EncryptedSignatureAcknowledged, - Failure(err) => OutEvent::Failure(err.context("Failure with Encrypted Signature")), + Failure(err) => OutEvent::CommunicationError(err.context("Failure with Encrypted Signature")), } } } diff --git a/swap/src/protocol/bob/event_loop.rs b/swap/src/protocol/bob/event_loop.rs index e31b429f..23ca57e1 100644 --- a/swap/src/protocol/bob/event_loop.rs +++ b/swap/src/protocol/bob/event_loop.rs @@ -192,7 +192,7 @@ impl EventLoop { debug!("Alice acknowledged encrypted signature"); } OutEvent::ResponseSent => {} - OutEvent::Failure(err) => { + OutEvent::CommunicationError(err) => { error!("Communication error: {:#}", err) } }