Skip to content

Commit

Permalink
fix from_compact
Browse files Browse the repository at this point in the history
  • Loading branch information
klkvr committed Oct 22, 2024
1 parent 3cb9bb2 commit 4cfadec
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions crates/storage/codecs/src/alloy/authorization_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,15 @@ impl Compact for SignedAuthorization {
}

fn from_compact(mut buf: &[u8], len: usize) -> (Self, &[u8]) {
let y = alloy_primitives::Parity::Parity(buf.get_u8() == 1);
let y_parity = buf.get_u8();
let r = U256::from_le_slice(&buf[0..32]);
buf.advance(32);
let s = U256::from_le_slice(&buf[0..32]);
buf.advance(32);

let signature = alloy_primitives::Signature::from_rs_and_parity(r, s, y)
.expect("invalid authorization signature");
let (auth, buf) = AlloyAuthorization::from_compact(buf, len);

(auth.into_signed(signature), buf)
(Self::new_unchecked(auth, y_parity, r, s), buf)
}
}

Expand Down

0 comments on commit 4cfadec

Please sign in to comment.