Skip to content

Commit

Permalink
feat: add set_sidecar to the callbuilder (alloy-rs#594)
Browse files Browse the repository at this point in the history
* feat: add set_sidecar to the callbuilder.

* lint: fmt
  • Loading branch information
EmperorOrokuSaki authored and ben186 committed Jul 27, 2024
1 parent 0a96f7b commit 187c2fd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion crates/contract/src/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down Expand Up @@ -299,6 +299,12 @@ impl<T: Transport + Clone, P: Provider<T, N>, 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 {
Expand Down

0 comments on commit 187c2fd

Please sign in to comment.