Skip to content

Commit 13ae5c5

Browse files
refactor(e2e): use alloy bindings and primitives in liquidity_source_notification test (#3788)
# Description <!--- Describe your changes to provide context for reviewers, including why it is needed --> A follow up to #3735 (comment) # Changes <!-- List of detailed changes (how the change is accomplished) --> Refactored test code to use alloy contract bindings and primitives ## How to test <!--- Include details of how to test your changes, including any pre-requisites. If no unit tests are included, please explain why and how to test manually 1. 2. 3. --> `$ FORK_URL_MAINNET="...." cargo test -p e2e forked_node_liquidity_source_notification_mainnet -- --ignored` <!-- ## Related Issues Fixes # --> --------- Co-authored-by: ilya <[email protected]> Co-authored-by: ilya <[email protected]>
1 parent 5172042 commit 13ae5c5

File tree

9 files changed

+4246
-1365
lines changed

9 files changed

+4246
-1365
lines changed

crates/contracts/artifacts/ILiquoriceSettlement.json

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

crates/contracts/artifacts/LiquoriceSettlement.json

Lines changed: 4191 additions & 0 deletions
Large diffs are not rendered by default.

crates/contracts/src/alloy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ crate::bindings!(
594594
);
595595

596596
crate::bindings!(
597-
ILiquoriceSettlement,
597+
LiquoriceSettlement,
598598
crate::deployments! {
599599
// <https://liquorice.gitbook.io/liquorice-docs/links/smart-contracts>
600600
MAINNET => address!("0x0448633eb8B0A42EfED924C42069E0DcF08fb552"),

crates/contracts/src/bin/vendor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ fn run() -> Result<()> {
107107
"Manually vendored ABI and bytecode for hooks trampoline contract",
108108
)
109109
.manual(
110-
"ILiquoriceSettlement",
110+
"LiquoriceSettlement",
111111
"Liquorice does not publish its code",
112112
)
113113
.npm(

crates/driver/src/infra/notify/liquidity_sources/liquorice/notifier.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use {
2020
alloy::primitives::Address,
2121
anyhow::{Context, Result, anyhow},
2222
chrono::Utc,
23-
contracts::alloy::ILiquoriceSettlement,
23+
contracts::alloy::LiquoriceSettlement,
2424
};
2525

2626
const NOTIFICATION_SOURCE: &str = "cow_protocol";
@@ -40,7 +40,7 @@ impl Notifier {
4040
chain: chain::Chain,
4141
) -> Result<Self> {
4242
let liquorice_settlement_contract_address =
43-
ILiquoriceSettlement::deployment_address(&chain.id())
43+
LiquoriceSettlement::deployment_address(&chain.id())
4444
.ok_or(anyhow!("Liquorice settlement contract not found"))?;
4545

4646
Ok(Self {
@@ -85,11 +85,11 @@ impl LiquiditySourceNotifying for Notifier {
8585
mod utils {
8686
use {
8787
crate::domain::{
88-
competition::{solution, solution::Settlement},
88+
competition::solution::{self, Settlement},
8989
eth,
9090
},
9191
alloy::{primitives::Address, sol_types::SolCall},
92-
contracts::alloy::ILiquoriceSettlement,
92+
contracts::alloy::LiquoriceSettlement,
9393
ethrpc::alloy::conversions::IntoAlloy,
9494
std::collections::HashSet,
9595
};
@@ -150,7 +150,7 @@ mod utils {
150150
}
151151

152152
// Decode the calldata using the Liquorice settlement contract ABI
153-
let input = ILiquoriceSettlement::ILiquoriceSettlement::settleSingleCall::abi_decode(
153+
let input = LiquoriceSettlement::LiquoriceSettlement::settleSingleCall::abi_decode(
154154
&interaction.call_data.0,
155155
)
156156
.ok()?;

crates/e2e/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ edition = "2024"
99
license = "MIT OR Apache-2.0"
1010

1111
[dependencies]
12-
alloy = { workspace = true, default-features = false, features = ["json-rpc", "providers", "rpc-client", "rpc-types", "transports", "reqwest", "signers", "signer-local", "signer-mnemonic","provider-anvil-api"] }
12+
alloy = { workspace = true, default-features = false, features = ["json-rpc", "providers", "rpc-client", "rpc-types", "transports", "reqwest", "signers", "signer-local", "signer-mnemonic", "provider-anvil-api", "sol-types"] }
1313
app-data = { workspace = true }
1414
anyhow = { workspace = true }
1515
autopilot = { workspace = true }
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
pub mod onchain;
21
pub mod server;

crates/e2e/src/api/liquorice/onchain.rs

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

0 commit comments

Comments
 (0)