mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore(reth-primitives): clean unused file (#10765)
This commit is contained in:
@ -1,43 +0,0 @@
|
|||||||
pub use alloy_consensus::TxEip1559;
|
|
||||||
#[cfg(test)]
|
|
||||||
mod tests {
|
|
||||||
use super::TxEip1559;
|
|
||||||
use crate::{
|
|
||||||
transaction::{signature::Signature, TxKind},
|
|
||||||
AccessList, Address, Transaction, TransactionSigned, B256, U256,
|
|
||||||
};
|
|
||||||
use std::str::FromStr;
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn recover_signer_eip1559() {
|
|
||||||
use crate::hex_literal::hex;
|
|
||||||
|
|
||||||
let signer: Address = hex!("dd6b8b3dc6b7ad97db52f08a275ff4483e024cea").into();
|
|
||||||
let hash: B256 =
|
|
||||||
hex!("0ec0b6a2df4d87424e5f6ad2a654e27aaeb7dac20ae9e8385cc09087ad532ee0").into();
|
|
||||||
|
|
||||||
let tx = Transaction::Eip1559( TxEip1559 {
|
|
||||||
chain_id: 1,
|
|
||||||
nonce: 0x42,
|
|
||||||
gas_limit: 44386,
|
|
||||||
to: TxKind::Call(hex!("6069a6c32cf691f5982febae4faf8a6f3ab2f0f6").into()),
|
|
||||||
value: U256::ZERO,
|
|
||||||
input: hex!("a22cb4650000000000000000000000005eee75727d804a2b13038928d36f8b188945a57a0000000000000000000000000000000000000000000000000000000000000000").into(),
|
|
||||||
max_fee_per_gas: 0x4a817c800,
|
|
||||||
max_priority_fee_per_gas: 0x3b9aca00,
|
|
||||||
access_list: AccessList::default(),
|
|
||||||
});
|
|
||||||
|
|
||||||
let sig = Signature {
|
|
||||||
r: U256::from_str("0x840cfc572845f5786e702984c2a582528cad4b49b2a10b9db1be7fca90058565")
|
|
||||||
.unwrap(),
|
|
||||||
s: U256::from_str("0x25e7109ceb98168d95b09b18bbf6b685130e0562f233877d492b94eee0c5b6d1")
|
|
||||||
.unwrap(),
|
|
||||||
odd_y_parity: false,
|
|
||||||
};
|
|
||||||
|
|
||||||
let signed_tx = TransactionSigned::from_transaction_and_signature(tx, sig);
|
|
||||||
assert_eq!(signed_tx.hash(), hash, "Expected same hash");
|
|
||||||
assert_eq!(signed_tx.recover_signer(), Some(signer), "Recovering signer should pass.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1 +0,0 @@
|
|||||||
pub use alloy_consensus::transaction::TxEip2930;
|
|
||||||
@ -1 +0,0 @@
|
|||||||
pub use alloy_consensus::transaction::TxEip4844;
|
|
||||||
@ -1 +0,0 @@
|
|||||||
pub use alloy_consensus::transaction::TxEip7702;
|
|
||||||
@ -1,43 +0,0 @@
|
|||||||
pub use alloy_consensus::TxLegacy;
|
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
mod tests {
|
|
||||||
use super::TxLegacy;
|
|
||||||
use crate::{
|
|
||||||
transaction::{signature::Signature, TxKind},
|
|
||||||
Address, Transaction, TransactionSigned, B256, U256,
|
|
||||||
};
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn recover_signer_legacy() {
|
|
||||||
use crate::hex_literal::hex;
|
|
||||||
|
|
||||||
let signer: Address = hex!("398137383b3d25c92898c656696e41950e47316b").into();
|
|
||||||
let hash: B256 =
|
|
||||||
hex!("bb3a336e3f823ec18197f1e13ee875700f08f03e2cab75f0d0b118dabb44cba0").into();
|
|
||||||
|
|
||||||
let tx = Transaction::Legacy(TxLegacy {
|
|
||||||
chain_id: Some(1),
|
|
||||||
nonce: 0x18,
|
|
||||||
gas_price: 0xfa56ea00,
|
|
||||||
gas_limit: 119902,
|
|
||||||
to: TxKind::Call(hex!("06012c8cf97bead5deae237070f9587f8e7a266d").into()),
|
|
||||||
value: U256::from(0x1c6bf526340000u64),
|
|
||||||
input: hex!("f7d8c88300000000000000000000000000000000000000000000000000000000000cee6100000000000000000000000000000000000000000000000000000000000ac3e1").into(),
|
|
||||||
});
|
|
||||||
|
|
||||||
let sig = Signature {
|
|
||||||
r: U256::from_be_bytes(hex!(
|
|
||||||
"2a378831cf81d99a3f06a18ae1b6ca366817ab4d88a70053c41d7a8f0368e031"
|
|
||||||
)),
|
|
||||||
s: U256::from_be_bytes(hex!(
|
|
||||||
"450d831a05b6e418724436c05c155e0a1b7b921015d0fbc2f667aed709ac4fb5"
|
|
||||||
)),
|
|
||||||
odd_y_parity: false,
|
|
||||||
};
|
|
||||||
|
|
||||||
let signed_tx = TransactionSigned::from_transaction_and_signature(tx, sig);
|
|
||||||
assert_eq!(signed_tx.hash(), hash, "Expected same hash");
|
|
||||||
assert_eq!(signed_tx.recover_signer(), Some(signer), "Recovering signer should pass.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -17,15 +17,12 @@ use rayon::prelude::{IntoParallelIterator, ParallelIterator};
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
pub use access_list::{AccessList, AccessListItem, AccessListResult};
|
pub use access_list::{AccessList, AccessListItem, AccessListResult};
|
||||||
pub use eip1559::TxEip1559;
|
|
||||||
pub use eip2930::TxEip2930;
|
pub use alloy_consensus::{TxEip1559, TxEip2930, TxEip4844, TxEip7702, TxLegacy};
|
||||||
pub use eip4844::TxEip4844;
|
|
||||||
pub use eip7702::TxEip7702;
|
|
||||||
|
|
||||||
pub use error::{
|
pub use error::{
|
||||||
InvalidTransactionError, TransactionConversionError, TryFromRecoveredTransactionError,
|
InvalidTransactionError, TransactionConversionError, TryFromRecoveredTransactionError,
|
||||||
};
|
};
|
||||||
pub use legacy::TxLegacy;
|
|
||||||
pub use meta::TransactionMeta;
|
pub use meta::TransactionMeta;
|
||||||
pub use pooled::{PooledTransactionsElement, PooledTransactionsElementEcRecovered};
|
pub use pooled::{PooledTransactionsElement, PooledTransactionsElementEcRecovered};
|
||||||
#[cfg(all(feature = "c-kzg", any(test, feature = "arbitrary")))]
|
#[cfg(all(feature = "c-kzg", any(test, feature = "arbitrary")))]
|
||||||
@ -44,12 +41,7 @@ pub use variant::TransactionSignedVariant;
|
|||||||
|
|
||||||
pub(crate) mod access_list;
|
pub(crate) mod access_list;
|
||||||
mod compat;
|
mod compat;
|
||||||
mod eip1559;
|
|
||||||
mod eip2930;
|
|
||||||
mod eip4844;
|
|
||||||
mod eip7702;
|
|
||||||
mod error;
|
mod error;
|
||||||
mod legacy;
|
|
||||||
mod meta;
|
mod meta;
|
||||||
mod pooled;
|
mod pooled;
|
||||||
mod sidecar;
|
mod sidecar;
|
||||||
@ -59,10 +51,7 @@ pub(crate) mod util;
|
|||||||
mod variant;
|
mod variant;
|
||||||
|
|
||||||
#[cfg(feature = "optimism")]
|
#[cfg(feature = "optimism")]
|
||||||
mod optimism;
|
pub use op_alloy_consensus::TxDeposit;
|
||||||
|
|
||||||
#[cfg(feature = "optimism")]
|
|
||||||
pub use optimism::TxDeposit;
|
|
||||||
#[cfg(feature = "optimism")]
|
#[cfg(feature = "optimism")]
|
||||||
pub use tx_type::DEPOSIT_TX_TYPE_ID;
|
pub use tx_type::DEPOSIT_TX_TYPE_ID;
|
||||||
|
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
pub use op_alloy_consensus::TxDeposit;
|
|
||||||
Reference in New Issue
Block a user