Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
joshieDo committed Jul 9, 2024
1 parent 010f8b6 commit df5495c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
13 changes: 6 additions & 7 deletions crates/primitives/src/transaction/eip7702.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,16 +243,14 @@ impl<'a> arbitrary::Arbitrary<'a> for TxEip7702 {
fn arbitrary(u: &mut arbitrary::Unstructured<'a>) -> arbitrary::Result<Self> {
use arbitrary::Arbitrary;
#[derive(Arbitrary)]
struct AbitrarySignedAuth {
struct ArbitrarySignedAuth {
chain_id: ChainId,
address: alloy_primitives::Address,
nonce: Option<u64>,
y: bool,
r: U256,
s: U256,
signature: alloy_primitives::Signature,
}

let iter = u.arbitrary_iter::<AbitrarySignedAuth>()?;
let iter = u.arbitrary_iter::<ArbitrarySignedAuth>()?;
let mut authorization_list = Vec::new();
for auth in iter {
let auth = auth?;
Expand All @@ -263,8 +261,9 @@ impl<'a> arbitrary::Arbitrary<'a> for TxEip7702 {
nonce: auth.nonce.into(),
}
.into_signed(
alloy_primitives::Signature::from_rs_and_parity(auth.r, auth.s, auth.y)
.expect("arbitrary generated invalid eip-7702 signature"),
auth.signature.with_parity(alloy_primitives::Parity::Parity(
auth.signature.v().y_parity(),
)),
),
);
}
Expand Down
8 changes: 1 addition & 7 deletions crates/storage/codecs/derive/src/compact/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,7 @@ fn generate_from_compact(fields: &FieldList, ident: &Ident, is_zstd: bool) -> To
// it's hard to figure out with derive_macro which types have Bytes fields.
//
// This removes the requirement of the field to be placed last in the struct.
known_types.extend_from_slice(&[
"TxKind",
"AccessList",
"AuthorizationList",
"Signature",
"CheckpointBlockRange",
]);
known_types.extend_from_slice(&["TxKind", "AccessList", "Signature", "CheckpointBlockRange"]);

// let mut handle = FieldListHandler::new(fields);
let is_enum = fields.iter().any(|field| matches!(field, FieldTypes::EnumVariant(_)));
Expand Down
2 changes: 1 addition & 1 deletion crates/storage/codecs/src/alloy/authorization_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl Compact for AlloyAuthorization {
}

fn from_compact(buf: &[u8], len: usize) -> (Self, &[u8]) {
let (authorization, _) = Authorization::from_compact(buf, len);
let (authorization, buf) = Authorization::from_compact(buf, len);
let alloy_authorization = Self {
chain_id: authorization.chain_id,
address: authorization.address,
Expand Down

0 comments on commit df5495c

Please sign in to comment.