Process execution setup failure similarly to other failures

By merging it in the failure event of the root behaviour.
This commit is contained in:
Franck Royer 2021-02-08 16:38:23 +11:00
parent 4ade5df0e5
commit f5ca5faabf
No known key found for this signature in database
GPG key ID: A82ED75A8DFC50A4
3 changed files with 15 additions and 12 deletions

View file

@ -20,7 +20,7 @@ pub enum OutEvent {
msg: SwapRequest,
channel: ResponseChannel<SwapResponse>,
},
ExecutionSetupDone(anyhow::Result<Box<State3>>),
ExecutionSetupDone(Box<State3>),
TransferProofAcknowledged,
EncryptedSignature {
msg: Box<EncryptedSignature>,
@ -53,8 +53,10 @@ impl From<alice::OutEvent> for OutEvent {
impl From<execution_setup::OutEvent> for OutEvent {
fn from(event: execution_setup::OutEvent) -> Self {
use crate::protocol::alice::execution_setup::OutEvent::*;
match event {
execution_setup::OutEvent::Done(res) => OutEvent::ExecutionSetupDone(res.map(Box::new)),
Done(state3) => OutEvent::ExecutionSetupDone(Box::new(state3)),
Failure(err) => OutEvent::Failure(err),
}
}
}