Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Leshiy committed Nov 14, 2024
1 parent 29a3ee4 commit 73ad037
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions rust/vote-tx-v2/src/decoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ impl Decode<'_, ()> for GeneralizedTx {
let signature = {
let sign_bytes = read_cbor_bytes(d)
.map_err(|_| minicbor::decode::Error::message("missing `signature` field"))?;
coset::CoseSign::from_slice(&sign_bytes).map_err(|_| {
let mut sign = coset::CoseSign::from_slice(&sign_bytes).map_err(|_| {
minicbor::decode::Error::message("`signature` must be COSE_Sign encoded object")
})?
})?;
// We dont need to hold the original encoded data of the COSE protected header
sign.protected.original_data = None;
sign
};

Ok(Self { tx_body, signature })
Expand Down

0 comments on commit 73ad037

Please sign in to comment.