Skip to content

Commit c2a17cd

Browse files
committed
Remove contracts dependency from ethrpc (cowprotocol#3796)
`ethrpc` only depends on 1 function from `contracts` which arguably shouldn't have been re-exported to begin with since it's only needed for `ethcontract` bindings. Removing that function from `ethrpc` means it no longer depends on `contracts` which allows `cargo` to compile it in parallel with `contracts`. Also where this `dummy` functionality lives become irrelevant when we finally switch to `alloy` completely since `alloy` does not need these dummy instances just to encode calldata. 🥳 - remove `contracts` dependency from `ethrpc` compiler
1 parent f949b9a commit c2a17cd

File tree

13 files changed

+13
-17
lines changed

13 files changed

+13
-17
lines changed

Cargo.lock

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

crates/driver/src/boundary/liquidity/balancer/v2/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ fn to_interaction(
7979
output: &liquidity::ExactOutput,
8080
receiver: &eth::Address,
8181
) -> eth::Interaction {
82-
let web3 = ethrpc::dummy::web3();
82+
let web3 = contracts::web3::dummy();
8383
let handler = balancer_v2::SettlementHandler::new(
8484
pool.id.into(),
8585
// Note that this code assumes `receiver == sender`. This assumption is

crates/driver/src/boundary/liquidity/balancer/v3/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ fn to_interaction(
8080
output: &liquidity::ExactOutput,
8181
receiver: &eth::Address,
8282
) -> eth::Interaction {
83-
let web3 = ethrpc::dummy::web3();
83+
let web3 = contracts::web3::dummy();
8484
let handler = balancer_v3::SettlementHandler::new(
8585
pool.id.into(),
8686
// Note that this code assumes `receiver == sender`. This assumption is

crates/driver/src/boundary/liquidity/uniswap/v2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ pub fn to_interaction(
9999
) -> eth::Interaction {
100100
let handler = uniswap_v2::Inner::new(
101101
pool.router.0.into_alloy(),
102-
GPv2Settlement::at(&ethrpc::dummy::web3(), receiver.0),
102+
GPv2Settlement::at(&contracts::web3::dummy(), receiver.0),
103103
Mutex::new(Allowances::empty(receiver.0)),
104104
);
105105

crates/driver/src/boundary/liquidity/uniswap/v3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ pub fn to_interaction(
7878
output: &liquidity::ExactOutput,
7979
receiver: &eth::Address,
8080
) -> eth::Interaction {
81-
let web3 = ethrpc::dummy::web3();
81+
let web3 = contracts::web3::dummy();
8282

8383
let handler = UniswapV3SettlementHandler::new(
8484
UniswapV3SwapRouterV2::at(&web3, pool.router.0),

crates/ethrpc/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ path = "src/lib.rs"
1414
alloy = { workspace = true, default-features = false, features = ["json-rpc", "providers", "rpc-client", "rpc-types", "transports", "reqwest", "signers", "signer-aws", "signer-local", "eips"] }
1515
anyhow = { workspace = true }
1616
async-trait = { workspace = true }
17-
contracts = { workspace = true }
1817
ethcontract = { workspace = true }
1918
futures = { workspace = true }
2019
hex = { workspace = true }

crates/ethrpc/src/dummy.rs

Lines changed: 0 additions & 3 deletions
This file was deleted.

crates/ethrpc/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
pub mod alloy;
22
pub mod block_stream;
33
pub mod buffered;
4-
pub mod dummy;
54
pub mod extensions;
65
pub mod http;
76
pub mod instrumented;

crates/liquidity-driver/src/boundary/liquidity/balancer/v2/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ fn to_interaction(
7979
output: &liquidity::ExactOutput,
8080
receiver: &eth::Address,
8181
) -> eth::Interaction {
82-
let web3 = ethrpc::dummy::web3();
82+
let web3 = contracts::web3::dummy();
8383
let handler = balancer_v2::SettlementHandler::new(
8484
pool.id.into(),
8585
// Note that this code assumes `receiver == sender`. This assumption is

crates/liquidity-driver/src/boundary/liquidity/balancer/v3/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ fn to_interaction(
8080
output: &liquidity::ExactOutput,
8181
receiver: &eth::Address,
8282
) -> eth::Interaction {
83-
let web3 = ethrpc::dummy::web3();
83+
let web3 = contracts::web3::dummy();
8484
let handler = balancer_v3::SettlementHandler::new(
8585
pool.id.into(),
8686
// Note that this code assumes `receiver == sender`. This assumption is

0 commit comments

Comments
 (0)