Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/e2e/src/setup/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ use {
crate::nodes::{NODE_HOST, Node},
::alloy::signers::local::{MnemonicBuilder, coins_bip39::English},
anyhow::{Result, anyhow},
ethcontract::futures::FutureExt,
ethrpc::Web3,
futures::FutureExt,
std::{
future::Future,
io::Write,
Expand Down
41 changes: 13 additions & 28 deletions crates/e2e/tests/e2e/ethflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,7 @@ use {
run_test,
wait_for_condition,
},
ethcontract::H160,
ethrpc::{
Web3,
alloy::{
CallBuilderExt,
conversions::{IntoAlloy, IntoLegacy},
},
block_stream::timestamp_of_current_block_in_seconds,
},
ethrpc::{Web3, alloy::CallBuilderExt, block_stream::timestamp_of_current_block_in_seconds},
model::{
DomainSeparator,
order::{
Expand Down Expand Up @@ -207,7 +199,7 @@ async fn eth_flow_tx(web3: Web3) {
test_trade_availability_in_api(
services.client(),
&ethflow_order,
&trader.address().into_legacy(),
&trader.address(),
onchain.contracts(),
ethflow_contract,
)
Expand Down Expand Up @@ -457,23 +449,16 @@ async fn test_order_availability_in_api(
let is_available = || async { services.get_order(&uid).await.is_ok() };
wait_for_condition(TIMEOUT, is_available).await.unwrap();

test_orders_query(
services,
order,
&owner.into_legacy(),
contracts,
ethflow_contract,
)
.await;
test_orders_query(services, order, owner, contracts, ethflow_contract).await;

// Api returns eth flow orders for both eth-flow contract address and actual
// owner
for address in [owner, ethflow_contract.address()] {
test_account_query(
&address.into_legacy(),
address,
services.client(),
order,
&owner.into_legacy(),
owner,
contracts,
ethflow_contract,
)
Expand All @@ -484,7 +469,7 @@ async fn test_order_availability_in_api(
async fn test_trade_availability_in_api(
client: &Client,
order: &ExtendedEthFlowOrder,
owner: &H160,
owner: &Address,
contracts: &Contracts,
ethflow_contract: &CoWSwapEthFlow::Instance,
) {
Expand All @@ -498,7 +483,7 @@ async fn test_trade_availability_in_api(

// Api returns eth flow orders for both eth-flow contract address and actual
// owner
for address in [owner, &ethflow_contract.address().into_legacy()] {
for address in [owner, ethflow_contract.address()] {
test_trade_query(
&TradeQuery::ByOwner(*address),
client,
Expand Down Expand Up @@ -529,7 +514,7 @@ async fn test_order_was_settled(ethflow_order: &ExtendedEthFlowOrder, onchain: &
async fn test_orders_query(
services: &Services<'_>,
order: &ExtendedEthFlowOrder,
owner: &H160,
owner: &Address,
contracts: &Contracts,
ethflow_contract: &CoWSwapEthFlow::Instance,
) {
Expand All @@ -541,10 +526,10 @@ async fn test_orders_query(
}

async fn test_account_query(
queried_account: &H160,
queried_account: &Address,
client: &Client,
order: &ExtendedEthFlowOrder,
owner: &H160,
owner: &Address,
contracts: &Contracts,
ethflow_contract: &CoWSwapEthFlow::Instance,
) {
Expand All @@ -564,7 +549,7 @@ async fn test_account_query(

enum TradeQuery {
ByUid(OrderUid),
ByOwner(H160),
ByOwner(Address),
}

async fn test_trade_query(
Expand Down Expand Up @@ -594,7 +579,7 @@ async fn test_trade_query(
async fn test_order_parameters(
response: &Order,
order: &ExtendedEthFlowOrder,
owner: &H160,
owner: &Address,
contracts: &Contracts,
ethflow_contract: &CoWSwapEthFlow::Instance,
) {
Expand All @@ -614,7 +599,7 @@ async fn test_order_parameters(
assert_eq!(
response.metadata.onchain_order_data,
Some(OnchainOrderData {
sender: owner.into_alloy(),
sender: *owner,
placement_error: None,
})
);
Expand Down
12 changes: 4 additions & 8 deletions crates/e2e/tests/e2e/liquidity.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use {
alloy::{
primitives::{Address, address},
primitives::{Address, B256, address},
providers::{
Provider,
ext::{AnvilApi, ImpersonateConfig},
Expand All @@ -21,11 +21,7 @@ use {
wait_for_condition,
},
},
ethcontract::H256,
ethrpc::{
Web3,
alloy::{CallBuilderExt, conversions::IntoLegacy},
},
ethrpc::{Web3, alloy::CallBuilderExt},
model::{
order::{OrderCreation, OrderKind},
signature::EcdsaSigningScheme,
Expand Down Expand Up @@ -403,7 +399,7 @@ async fn fill_or_kill_zeroex_limit_order(
zeroex: &IZeroex::Instance,
zeroex_order: &shared::zeroex_api::OrderRecord,
from: Address,
) -> anyhow::Result<H256> {
) -> anyhow::Result<B256> {
let order = zeroex_order.order();
let tx_hash = zeroex
.fillOrKillLimitOrder(
Expand Down Expand Up @@ -435,5 +431,5 @@ async fn fill_or_kill_zeroex_limit_order(
.watch()
.await?;

Ok(tx_hash.into_legacy())
Ok(tx_hash)
}
Loading