Skip to content

Commit ef761ec

Browse files
authored
feat: support all blob envelope in cast (#12557)
1 parent 7099e33 commit ef761ec

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

crates/cast/src/lib.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
44
#![cfg_attr(docsrs, feature(doc_cfg))]
55

6-
use alloy_consensus::{Header, TxEnvelope};
6+
use alloy_consensus::{EthereumTxEnvelope, Header, TxEip4844Variant};
77
use alloy_dyn_abi::{DynSolType, DynSolValue, FunctionExt};
8+
use alloy_eips::eip7594::BlobTransactionSidecarVariant;
89
use alloy_ens::NameOrAddress;
910
use alloy_json_abi::Function;
1011
use alloy_network::{AnyNetwork, AnyRpcTransaction};
@@ -2316,9 +2317,11 @@ impl SimpleCast {
23162317
/// let tx = "0x02f8f582a86a82058d8459682f008508351050808303fd84948e42f2f4101563bf679975178e880fd87d3efd4e80b884659ac74b00000000000000000000000080f0c1c49891dcfdd40b6e0f960f84e6042bcb6f000000000000000000000000b97ef9ef8734c71904d8002f8b6bc66dd9c48a6e00000000000000000000000000000000000000000000000000000000007ff4e20000000000000000000000000000000000000000000000000000000000000064c001a05d429597befe2835396206781b199122f2e8297327ed4a05483339e7a8b2022aa04c23a7f70fb29dda1b4ee342fb10a625e9b8ddc6a603fb4e170d4f6f37700cb8";
23172318
/// let tx_envelope = Cast::decode_raw_transaction(&tx)?;
23182319
/// # Ok::<(), eyre::Report>(())
2319-
pub fn decode_raw_transaction(tx: &str) -> Result<TxEnvelope> {
2320+
pub fn decode_raw_transaction(
2321+
tx: &str,
2322+
) -> Result<EthereumTxEnvelope<TxEip4844Variant<BlobTransactionSidecarVariant>>> {
23202323
let tx_hex = hex::decode(tx)?;
2321-
let tx = TxEnvelope::decode_2718(&mut tx_hex.as_slice())?;
2324+
let tx = Decodable2718::decode_2718(&mut tx_hex.as_slice())?;
23222325
Ok(tx)
23232326
}
23242327
}

0 commit comments

Comments
 (0)