dev(primitives): signature conversion (#10371)

This commit is contained in:
greged93
2024-08-17 10:06:19 -07:00
committed by GitHub
parent 2d58c0bd3e
commit a918779f2c

View File

@@ -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]