feat(primitives): re-export alloy Recovered (#13670)

This commit is contained in:
bendanzhentan
2025-01-07 01:20:58 +08:00
committed by GitHub
parent fbf7430d9b
commit 20e003f9b4
7 changed files with 39 additions and 179 deletions

View File

@ -60,7 +60,7 @@ impl TryFrom<RecoveredTx<OpTransactionSigned>> for OpPooledTransaction {
fn try_from(value: RecoveredTx<OpTransactionSigned>) -> Result<Self, Self::Error> {
let (tx, signer) = value.into_parts();
let pooled: RecoveredTx<op_alloy_consensus::OpPooledTransaction> =
RecoveredTx::from_signed_transaction(tx.try_into()?, signer);
RecoveredTx::new_unchecked(tx.try_into()?, signer);
Ok(pooled.into())
}
}
@ -84,7 +84,7 @@ impl PoolTransaction for OpPooledTransaction {
tx: RecoveredTx<Self::Consensus>,
) -> Result<RecoveredTx<Self::Pooled>, Self::TryFromConsensusError> {
let (tx, signer) = tx.into_parts();
Ok(RecoveredTx::from_signed_transaction(tx.try_into()?, signer))
Ok(RecoveredTx::new_unchecked(tx.try_into()?, signer))
}
fn hash(&self) -> &TxHash {
@ -459,7 +459,7 @@ mod tests {
});
let signature = Signature::test_signature();
let signed_tx = OpTransactionSigned::new_unhashed(deposit_tx, signature);
let signed_recovered = RecoveredTx::from_signed_transaction(signed_tx, signer);
let signed_recovered = RecoveredTx::new_unchecked(signed_tx, signer);
let len = signed_recovered.encode_2718_len();
let pooled_tx = OpPooledTransaction::new(signed_recovered, len);
let outcome = validator.validate_one(origin, pooled_tx);

View File

@ -67,7 +67,7 @@ impl OpPayloadTransactions for CustomTxPriority {
..Default::default()
};
let signature = sender.sign_transaction_sync(&mut end_of_block_tx).unwrap();
let end_of_block_tx = RecoveredTx::from_signed_transaction(
let end_of_block_tx = RecoveredTx::new_unchecked(
OpTransactionSigned::new_unhashed(
OpTypedTransaction::Eip1559(end_of_block_tx),
signature,