You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every protocol defines several verify_*_is_invalid to check invalid message evidence. An example implementation looks like this:
fnverify_echo_broadcast_is_invalid(deserializer:&Deserializer,round_id:&RoundId,message:&EchoBroadcast,) -> Result<(),MessageValidationError>{match round_id {
r if r == &RoundId::new(1) => message.verify_is_not::<Round1EchoBroadcast>(deserializer),
r if r == &RoundId::new(2) => message.verify_is_not::<Round2EchoBroadcast<P>>(deserializer),
r if r == &RoundId::new(3) => message.verify_is_some(),
_ => Err(MessageValidationError::InvalidEvidence("Invalid round number".into())),}}
How can this be simplified? Seems like it'll have to be a macro. Something that seems possible is a macro for every method, something like
Every protocol defines several
verify_*_is_invalid
to check invalid message evidence. An example implementation looks like this:How can this be simplified? Seems like it'll have to be a macro. Something that seems possible is a macro for every method, something like
Even better, if we could merge all message parts into one macro, something like
but I am not sure if it is possible in Rust, because it will require transposing the variable length token sequence.
The text was updated successfully, but these errors were encountered: