feat: Improve multiplexer ergonomics (#111)

This commit is contained in:
Santiago Carmuega 2022-06-04 17:39:29 -03:00 committed by GitHub
parent 4ea3e134c0
commit 159d38020c
18 changed files with 242 additions and 261 deletions

View file

@ -250,7 +250,7 @@ where
self.on_intersect_found(point, tip)
}
(State::Intersect, Message::IntersectNotFound(tip)) => self.on_intersect_not_found(tip),
(_, msg) => Err(MachineError::InvalidMsgForState(self.state, msg)),
(state, msg) => Err(MachineError::invalid_msg::<Self>(state, &msg)),
}
}
}
@ -347,7 +347,7 @@ impl Agent for TipFinder {
self.on_intersect_found(tip)
}
(State::Intersect, Message::IntersectNotFound(tip)) => self.on_intersect_not_found(tip),
(state, msg) => Err(MachineError::InvalidMsgForState(state.clone(), msg)),
(state, msg) => Err(MachineError::invalid_msg::<Self>(state, &msg)),
}
}
}

View file

@ -45,5 +45,11 @@ impl Deref for BlockContent {
}
}
impl From<BlockContent> for Vec<u8> {
fn from(other: BlockContent) -> Self {
other.0
}
}
#[derive(Debug)]
pub struct SkippedContent;