-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: move to alloy pt5 * chore: add signature type * chore: todo * chore: remove error * fix: error * chore: add todo * chore: fix errors * chore: fix errors * chore: compilable version * chore: todo * chore: lint evm input * chore: lint executor * chore: lint external tx * chore: lint tx input * chore: repalce blockchain client * chore: remove tx types * chore: replace keccak256 * chore: remove rng from ethers * chore: fix merge * chore: update evm_input * chore: update executor * chore: remove unused import * chore: improve naming and proc tests * chore: paths * chore: doc * fix: tx input * chore: make more clear the types of txs * chore: improve chain id * chore: remove todo * enha: refine Decodable supporting legacy and types transactions * chore: improve * chore: remove doc * chore: improve * chore: remove outdated fn because we receive type in txs now * chore: remove unused default derive * chore: remove unused EthersTransaction type alias * chore: reorder
- Loading branch information
1 parent
29f6841
commit 9de7f30
Showing
17 changed files
with
213 additions
and
133 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
use alloy_primitives::Uint; | ||
use display_json::DebugAsJson; | ||
use ethereum_types::U256; | ||
use fake::Dummy; | ||
use fake::Faker; | ||
use rand::Rng; | ||
|
||
use crate::alias::AlloyUint256; | ||
use crate::gen_newtype_from; | ||
|
||
/// A signature component (r or s value) | ||
#[derive(DebugAsJson, Clone, Copy, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)] | ||
pub struct SignatureComponent(pub U256); | ||
|
||
impl Dummy<Faker> for SignatureComponent { | ||
fn dummy_with_rng<R: Rng + ?Sized>(_: &Faker, rng: &mut R) -> Self { | ||
Self(U256::from(rng.gen::<u64>())) | ||
} | ||
} | ||
|
||
// ----------------------------------------------------------------------------- | ||
// Conversions: Other -> Self | ||
// ----------------------------------------------------------------------------- | ||
gen_newtype_from!(self = SignatureComponent, other = U256); | ||
|
||
impl From<Uint<256, 4>> for SignatureComponent { | ||
fn from(value: Uint<256, 4>) -> Self { | ||
Self(U256::from(value.to_be_bytes::<32>())) | ||
} | ||
} | ||
|
||
// ----------------------------------------------------------------------------- | ||
// Conversions: Self -> Other | ||
// ----------------------------------------------------------------------------- | ||
impl From<SignatureComponent> for AlloyUint256 { | ||
fn from(value: SignatureComponent) -> Self { | ||
Self::from_limbs(value.0 .0) | ||
} | ||
} | ||
|
||
impl From<SignatureComponent> for U256 { | ||
fn from(value: SignatureComponent) -> Self { | ||
value.0 | ||
} | ||
} |
Oops, something went wrong.