feat: support blobs in eth_sendRawTransaction (#4495)

This commit is contained in:
Dan Cline
2023-09-06 08:48:15 -04:00
committed by GitHub
parent 6299c26b56
commit 422d930914
6 changed files with 32 additions and 11 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
//! Decoding tests for [`PooledTransactions`]
use reth_eth_wire::PooledTransactions;
use reth_primitives::{hex, PooledTransactionsElement};
use reth_primitives::{hex, Bytes, PooledTransactionsElement};
use reth_rlp::Decodable;
use std::{fs, path::PathBuf};
@ -21,3 +21,13 @@ fn decode_blob_transaction_data() {
let hex_data = hex::decode(data.trim()).unwrap();
let _txs = PooledTransactionsElement::decode(&mut &hex_data[..]).unwrap();
}
#[test]
fn decode_blob_rpc_transaction() {
// test data pulled from hive test that sends blob transactions
let network_data_path =
PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("testdata/rpc_blob_transaction");
let data = fs::read_to_string(network_data_path).expect("Unable to read file");
let hex_data = Bytes::from(hex::decode(data.trim()).unwrap());
let _txs = PooledTransactionsElement::decode_enveloped(hex_data).unwrap();
}