From 61d93072d87c7bef85ab8a9e5328c6267ca4d03f Mon Sep 17 00:00:00 2001 From: EmperorOrokuSaki Date: Sun, 21 Apr 2024 14:40:31 +0400 Subject: [PATCH 1/2] feat: add set_sidecar to the callbuilder. --- 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 993b4abad80..e3b62eca1ed 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, U256}; use alloy_provider::{PendingTransactionBuilder, Provider}; -use alloy_rpc_types::{state::StateOverride, BlockId}; +use alloy_rpc_types::{state::StateOverride, BlockId, BlobTransactionSidecar}; use alloy_sol_types::SolCall; use alloy_transport::Transport; use std::{ @@ -280,6 +280,12 @@ impl, D: CallDecoder, N: Network> CallBu self } + /// 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 { todo!() From 147be880c4544d96dd2bb0bc04cdc6bf9733ebd9 Mon Sep 17 00:00:00 2001 From: EmperorOrokuSaki Date: Sun, 21 Apr 2024 14:57:14 +0400 Subject: [PATCH 2/2] lint: fmt --- crates/contract/src/call.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/contract/src/call.rs b/crates/contract/src/call.rs index e3b62eca1ed..61660645e2d 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, U256}; use alloy_provider::{PendingTransactionBuilder, Provider}; -use alloy_rpc_types::{state::StateOverride, BlockId, BlobTransactionSidecar}; +use alloy_rpc_types::{state::StateOverride, BlobTransactionSidecar, BlockId}; use alloy_sol_types::SolCall; use alloy_transport::Transport; use std::{