Skip to content

Commit

Permalink
Restore decode_signed_message
Browse files Browse the repository at this point in the history
  • Loading branch information
kayabaNerve committed Nov 5, 2023
1 parent 6250643 commit f1e5206
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions coordinator/tributary/src/tendermint/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,17 @@ impl Transaction for TendermintTx {
}
}

fn decode_and_verify_signed_message<N: Network>(
pub fn decode_signed_message<N: Network>(
mut data: &[u8],
) -> Result<SignedMessageFor<N>, TransactionError> {
SignedMessageFor::<N>::decode(&mut data).map_err(|_| TransactionError::InvalidContent)
}

fn decode_and_verify_signed_message<N: Network>(
data: &[u8],
schema: &N::SignatureScheme,
) -> Result<SignedMessageFor<N>, TransactionError> {
let msg =
SignedMessageFor::<N>::decode(&mut data).map_err(|_| TransactionError::InvalidContent)?;
let msg = decode_signed_message::<N>(data)?;

// verify that evidence messages are signed correctly
if !msg.verify_signature(schema) {
Expand Down

0 comments on commit f1e5206

Please sign in to comment.