|
1 | 1 | //! The test driver handles the compilation and execution of the test cases. |
2 | 2 |
|
3 | 3 | use alloy::json_abi::JsonAbi; |
4 | | -use alloy::network::TransactionBuilder; |
| 4 | +use alloy::network::{Ethereum, TransactionBuilder}; |
5 | 5 | use alloy::rpc::types::TransactionReceipt; |
6 | 6 | use alloy::rpc::types::trace::geth::GethTrace; |
7 | 7 | use alloy::{ |
@@ -135,17 +135,21 @@ where |
135 | 135 | std::any::type_name::<T>() |
136 | 136 | ); |
137 | 137 |
|
138 | | - let tx = |
139 | | - match input.legacy_transaction(nonce, &self.deployed_contracts, &self.deployed_abis) { |
140 | | - Ok(tx) => { |
141 | | - tracing::debug!("Legacy transaction data: {tx:#?}"); |
142 | | - tx |
143 | | - } |
144 | | - Err(err) => { |
145 | | - tracing::error!("Failed to construct legacy transaction: {err:?}"); |
146 | | - return Err(err); |
147 | | - } |
148 | | - }; |
| 138 | + let tx = match input.legacy_transaction( |
| 139 | + nonce, |
| 140 | + &self.deployed_contracts, |
| 141 | + &self.deployed_abis, |
| 142 | + node, |
| 143 | + ) { |
| 144 | + Ok(tx) => { |
| 145 | + tracing::debug!("Legacy transaction data: {tx:#?}"); |
| 146 | + tx |
| 147 | + } |
| 148 | + Err(err) => { |
| 149 | + tracing::error!("Failed to construct legacy transaction: {err:?}"); |
| 150 | + return Err(err); |
| 151 | + } |
| 152 | + }; |
149 | 153 |
|
150 | 154 | tracing::trace!("Executing transaction for input: {input:?}"); |
151 | 155 |
|
@@ -231,10 +235,12 @@ where |
231 | 235 | // automatically fill in all of the missing fields from the provider that we |
232 | 236 | // are using. |
233 | 237 | let code = alloy::hex::decode(&code)?; |
234 | | - let tx = TransactionRequest::default() |
235 | | - .nonce(nonce) |
236 | | - .from(input.caller) |
237 | | - .with_deploy_code(code); |
| 238 | + let tx = { |
| 239 | + let tx = TransactionRequest::default() |
| 240 | + .nonce(nonce) |
| 241 | + .from(input.caller); |
| 242 | + TransactionBuilder::<Ethereum>::with_deploy_code(tx, code) |
| 243 | + }; |
238 | 244 |
|
239 | 245 | let receipt = match node.execute_transaction(tx) { |
240 | 246 | Ok(receipt) => receipt, |
|
0 commit comments