Skip to content

Commit 86dada2

Browse files
committed
Added nonce for legacy transaction also
1 parent 904f411 commit 86dada2

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

crates/core/src/driver/mod.rs

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,27 @@ where
119119
) -> anyhow::Result<(GethTrace, DiffMode)> {
120120
log::trace!("Calling execute_input for input: {:?}", input);
121121

122-
let tx = match input.legacy_transaction(self.config.network_id, 0, &self.deployed_contracts)
123-
{
124-
Ok(tx) => tx,
125-
Err(err) => {
126-
log::error!("Failed to construct legacy transaction: {:?}", err);
127-
return Err(err.into());
128-
}
129-
};
122+
let nonce = node.fetch_add_nonce(input.caller)?;
123+
124+
log::debug!(
125+
"Nonce calculated on the execute contract, calculated nonce {}, for contract {}, having address {} on node: {}",
126+
&nonce,
127+
&input.instance,
128+
&input.caller,
129+
std::any::type_name::<T>()
130+
);
131+
132+
let tx =
133+
match input.legacy_transaction(self.config.network_id, nonce, &self.deployed_contracts)
134+
{
135+
Ok(tx) => tx,
136+
Err(err) => {
137+
log::error!("Failed to construct legacy transaction: {:?}", err);
138+
return Err(err.into());
139+
}
140+
};
130141

131-
log::trace!("Executing transaction...");
142+
log::trace!("Executing transaction for input: {:?}", input);
132143

133144
let receipt = match node.execute_transaction(tx) {
134145
Ok(receipt) => receipt,

0 commit comments

Comments
 (0)