Skip to content

Commit

Permalink
fix: set both tx input fields (#8373)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Jul 6, 2024
1 parent 1bac1b3 commit 3ae4f50
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions crates/cast/bin/tx.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use alloy_consensus::{SidecarBuilder, SimpleCoder};
use alloy_json_abi::Function;
use alloy_network::{AnyNetwork, TransactionBuilder};
use alloy_primitives::{hex, Address, TxKind};
use alloy_primitives::{hex, Address, Bytes, TxKind};
use alloy_provider::Provider;
use alloy_rpc_types::TransactionRequest;
use alloy_rpc_types::{TransactionInput, TransactionRequest};
use alloy_serde::WithOtherFields;
use alloy_transport::Transport;
use eyre::Result;
Expand Down Expand Up @@ -232,7 +232,11 @@ where
let from = from.into().resolve(&self.provider).await?;

self.tx.set_kind(self.state.kind);
self.tx.set_input(self.state.input);

// we set both fields to the same value because some nodes only accept the legacy `data` field: <https://github.com/foundry-rs/foundry/issues/7764#issuecomment-2210453249>
let input = Bytes::from(self.state.input);
self.tx.input = TransactionInput { input: Some(input.clone()), data: Some(input) };

self.tx.set_from(from);
self.tx.set_chain_id(self.chain.id());

Expand Down

0 comments on commit 3ae4f50

Please sign in to comment.