stratus/eth/primitives/
signature_component.rs1use alloy_primitives::U256;
2use display_json::DebugAsJson;
3#[cfg(test)]
4use fake::Dummy;
5#[cfg(test)]
6use fake::Faker;
7#[cfg(test)]
8use rand::Rng;
9
10#[derive(DebugAsJson, Clone, Copy, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
12pub struct SignatureComponent(pub U256);
13
14#[cfg(test)]
15impl Dummy<Faker> for SignatureComponent {
16 fn dummy_with_rng<R: Rng + ?Sized>(_: &Faker, rng: &mut R) -> Self {
17 Self(U256::random_with(rng))
18 }
19}
20
21impl From<U256> for SignatureComponent {
26 fn from(value: U256) -> Self {
27 Self(value)
28 }
29}
30
31impl From<SignatureComponent> for U256 {
36 fn from(value: SignatureComponent) -> Self {
37 value.0
38 }
39}