mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: impl Encodable2718 and Decodable2718 for PooledTransactionsElement (#11482)
This commit is contained in:
@ -676,6 +676,7 @@ mod tests {
|
||||
blobstore::InMemoryBlobStore, validate::EthTransactionValidatorBuilder,
|
||||
CoinbaseTipOrdering, EthPooledTransaction, Pool, TransactionOrigin,
|
||||
};
|
||||
use alloy_eips::eip2718::Decodable2718;
|
||||
use alloy_primitives::{hex, U256};
|
||||
use reth_chainspec::MAINNET;
|
||||
use reth_fs_util as fs;
|
||||
@ -699,7 +700,7 @@ mod tests {
|
||||
let temp_dir = tempfile::tempdir().unwrap();
|
||||
let transactions_path = temp_dir.path().join(FILENAME).with_extension(EXTENSION);
|
||||
let tx_bytes = hex!("02f87201830655c2808505ef61f08482565f94388c818ca8b9251b393131c08a736a67ccb192978801049e39c4b5b1f580c001a01764ace353514e8abdfb92446de356b260e3c1225b73fc4c8876a6258d12a129a04f02294aa61ca7676061cd99f29275491218b4754b46a0248e5e42bc5091f507");
|
||||
let tx = PooledTransactionsElement::decode_enveloped(&mut &tx_bytes[..]).unwrap();
|
||||
let tx = PooledTransactionsElement::decode_2718(&mut &tx_bytes[..]).unwrap();
|
||||
let provider = MockEthProvider::default();
|
||||
let transaction: EthPooledTransaction = tx.try_into_ecrecovered().unwrap().into();
|
||||
let tx_to_cmp = transaction.clone();
|
||||
|
||||
@ -1051,7 +1051,7 @@ impl EthPooledTransaction {
|
||||
/// Conversion from the network transaction type to the pool transaction type.
|
||||
impl From<PooledTransactionsElementEcRecovered> for EthPooledTransaction {
|
||||
fn from(tx: PooledTransactionsElementEcRecovered) -> Self {
|
||||
let encoded_length = tx.length_without_header();
|
||||
let encoded_length = tx.encode_2718_len();
|
||||
let (tx, signer) = tx.into_components();
|
||||
match tx {
|
||||
PooledTransactionsElement::BlobTransaction(tx) => {
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user