stratus/eth/primitives/
signature_component.rs1use alloy_primitives::U256;
2use display_json::DebugAsJson;
3use fake::Dummy;
4use fake::Faker;
5use rand::Rng;
6
7#[derive(DebugAsJson, Clone, Copy, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
9pub struct SignatureComponent(pub U256);
10
11impl Dummy<Faker> for SignatureComponent {
12 fn dummy_with_rng<R: Rng + ?Sized>(_: &Faker, rng: &mut R) -> Self {
13 Self(U256::random_with(rng))
14 }
15}
16
17impl From<U256> for SignatureComponent {
22 fn from(value: U256) -> Self {
23 Self(value)
24 }
25}
26
27impl From<SignatureComponent> for U256 {
32 fn from(value: SignatureComponent) -> Self {
33 value.0
34 }
35}