mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: use generics for RecoveredTx (#13650)
This commit is contained in:
@ -904,10 +904,10 @@ impl EthPoolTransaction for MockTransaction {
|
||||
}
|
||||
}
|
||||
|
||||
impl TryFrom<RecoveredTx> for MockTransaction {
|
||||
impl TryFrom<RecoveredTx<TransactionSigned>> for MockTransaction {
|
||||
type Error = TryFromRecoveredTransactionError;
|
||||
|
||||
fn try_from(tx: RecoveredTx) -> Result<Self, Self::Error> {
|
||||
fn try_from(tx: RecoveredTx<TransactionSigned>) -> Result<Self, Self::Error> {
|
||||
let sender = tx.signer();
|
||||
let transaction = tx.into_signed();
|
||||
let hash = transaction.hash();
|
||||
@ -1053,7 +1053,7 @@ impl From<PooledTransactionsElementEcRecovered> for MockTransaction {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<MockTransaction> for RecoveredTx {
|
||||
impl From<MockTransaction> for RecoveredTx<TransactionSigned> {
|
||||
fn from(tx: MockTransaction) -> Self {
|
||||
let signed_tx =
|
||||
TransactionSigned::new(tx.clone().into(), Signature::test_signature(), *tx.hash());
|
||||
|
||||
@ -1453,10 +1453,10 @@ impl EthPoolTransaction for EthPooledTransaction {
|
||||
}
|
||||
}
|
||||
|
||||
impl TryFrom<RecoveredTx> for EthPooledTransaction {
|
||||
impl TryFrom<RecoveredTx<TransactionSigned>> for EthPooledTransaction {
|
||||
type Error = TryFromRecoveredTransactionError;
|
||||
|
||||
fn try_from(tx: RecoveredTx) -> Result<Self, Self::Error> {
|
||||
fn try_from(tx: RecoveredTx<TransactionSigned>) -> Result<Self, Self::Error> {
|
||||
// ensure we can handle the transaction type and its format
|
||||
match tx.ty() {
|
||||
0..=EIP1559_TX_TYPE_ID | EIP7702_TX_TYPE_ID => {
|
||||
@ -1480,7 +1480,7 @@ impl TryFrom<RecoveredTx> for EthPooledTransaction {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<EthPooledTransaction> for RecoveredTx {
|
||||
impl From<EthPooledTransaction> for RecoveredTx<TransactionSigned> {
|
||||
fn from(tx: EthPooledTransaction) -> Self {
|
||||
tx.transaction
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user