Skip to content

Commit

Permalink
dev(primitives): signature conversion (paradigmxyz#10371)
Browse files Browse the repository at this point in the history
  • Loading branch information
greged93 authored Aug 17, 2024
1 parent 2d58c0b commit a918779
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/primitives/src/transaction/signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,12 @@ impl Signature {
}
}

impl From<alloy_primitives::Signature> for Signature {
fn from(value: alloy_primitives::Signature) -> Self {
Self { r: value.r(), s: value.s(), odd_y_parity: value.v().y_parity() }
}
}

/// Outputs (`odd_y_parity`, `chain_id`) from the `v` value.
/// This doesn't check validity of the `v` value for optimism.
#[inline]
Expand Down

0 comments on commit a918779

Please sign in to comment.