Skip to content

Commit 0b97d7d

Browse files
authored
Support other matterlabs variables (#43)
* Introduce a custom kitchensink network * fix formatting * Added `--dev` to `substrate-node` arguments. This commit adds the `--dev` argument to the `substrate-node` to allow the chain to keep advancing as time goes own. We have found that if this option is not added then the chain won't advance forward. * fix clippy warning * fix clippy warning * Fix function selector and argument encoding * Avoid extra buffer allocation * Remove reliance on the web3 crate * Update the async runtime with syntactic sugar. * Fix tests * Fix doc test * Give nodes a standard way to get their alloy provider * Add ability to get the chain_id from node * Get kitchensink provider to use kitchensink network * Use provider method in tests * Add support for getting the gas limit from the node * Add a way to get the coinbase address * Add a way to get the block difficulty from the node * Add a way to get block info from the node * Expose APIs for getting the info of a specific block * Add resolution logic for other matterlabs variables * Fix tests * Add comment on alternative solutions * Change kitchensink gas limit assertion * Remove un-needed profile config
1 parent 2bee2d5 commit 0b97d7d

File tree

8 files changed

+748
-109
lines changed

8 files changed

+748
-109
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/core/src/driver/mod.rs

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! The test driver handles the compilation and execution of the test cases.
22
33
use alloy::json_abi::JsonAbi;
4-
use alloy::network::TransactionBuilder;
4+
use alloy::network::{Ethereum, TransactionBuilder};
55
use alloy::rpc::types::TransactionReceipt;
66
use alloy::rpc::types::trace::geth::GethTrace;
77
use alloy::{
@@ -134,17 +134,21 @@ where
134134
std::any::type_name::<T>()
135135
);
136136

137-
let tx =
138-
match input.legacy_transaction(nonce, &self.deployed_contracts, &self.deployed_abis) {
139-
Ok(tx) => {
140-
tracing::debug!("Legacy transaction data: {tx:#?}");
141-
tx
142-
}
143-
Err(err) => {
144-
tracing::error!("Failed to construct legacy transaction: {err:?}");
145-
return Err(err);
146-
}
147-
};
137+
let tx = match input.legacy_transaction(
138+
nonce,
139+
&self.deployed_contracts,
140+
&self.deployed_abis,
141+
node,
142+
) {
143+
Ok(tx) => {
144+
tracing::debug!("Legacy transaction data: {tx:#?}");
145+
tx
146+
}
147+
Err(err) => {
148+
tracing::error!("Failed to construct legacy transaction: {err:?}");
149+
return Err(err);
150+
}
151+
};
148152

149153
tracing::trace!("Executing transaction for input: {input:?}");
150154

@@ -253,10 +257,12 @@ where
253257
return Err(error.into());
254258
}
255259
};
256-
let tx = TransactionRequest::default()
257-
.nonce(nonce)
258-
.from(input.caller)
259-
.with_deploy_code(code);
260+
let tx = {
261+
let tx = TransactionRequest::default()
262+
.nonce(nonce)
263+
.from(input.caller);
264+
TransactionBuilder::<Ethereum>::with_deploy_code(tx, code)
265+
};
260266

261267
let receipt = match node.execute_transaction(tx) {
262268
Ok(receipt) => receipt,

crates/format/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ repository.workspace = true
99
rust-version.workspace = true
1010

1111
[dependencies]
12+
revive-dt-node-interaction = { workspace = true }
13+
1214
alloy = { workspace = true }
1315
alloy-primitives = { workspace = true }
1416
alloy-sol-types = { workspace = true }

0 commit comments

Comments
 (0)