From 187c2fd819d0357be6b5a50e6c1585a9b25d33ea Mon Sep 17 00:00:00 2001 From: Nima Rasooli <110225819+EmperorOrokuSaki@users.noreply.github.com> Date: Mon, 22 Apr 2024 13:45:01 +0400 Subject: [PATCH] feat: add set_sidecar to the callbuilder (#594) * feat: add set_sidecar to the callbuilder. * lint: fmt --- crates/contract/src/call.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/contract/src/call.rs b/crates/contract/src/call.rs index deba8d670a5..b76dfbd0ca4 100644 --- a/crates/contract/src/call.rs +++ b/crates/contract/src/call.rs @@ -4,7 +4,7 @@ use alloy_json_abi::Function; use alloy_network::{Ethereum, Network, ReceiptResponse, TransactionBuilder}; use alloy_primitives::{Address, Bytes, TxKind, U256}; use alloy_provider::{PendingTransactionBuilder, Provider}; -use alloy_rpc_types::{state::StateOverride, BlockId}; +use alloy_rpc_types::{state::StateOverride, BlobTransactionSidecar, BlockId}; use alloy_sol_types::SolCall; use alloy_transport::Transport; use std::{ @@ -299,6 +299,12 @@ impl, D: CallDecoder, N: Network> CallBu Address::ZERO } } + + /// Sets the `sidecar` field in the transaction to the provided value. + pub fn sidecar(mut self, blob_sidecar: BlobTransactionSidecar) -> Self { + self.request.set_blob_sidecar(blob_sidecar); + self + } /// Uses a Legacy transaction instead of an EIP-1559 one to execute the call pub fn legacy(self) -> Self {