Skip to content

Commit 2e7b53d

Browse files
committed
Rename liquidity_pairs to token_liquidity
1 parent 66aea2d commit 2e7b53d

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

crates/driver/src/domain/quote.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ impl Order {
9191
liquidity: &infra::liquidity::Fetcher,
9292
tokens: &infra::tokens::Fetcher,
9393
) -> Result<Quote, Error> {
94-
let liquidity = match (solver.liquidity(), self.liquidity_pairs()) {
94+
let liquidity = match (solver.liquidity(), self.token_liquidity()) {
9595
(solver::Liquidity::Fetch, Some(pairs)) => {
9696
liquidity
9797
.fetch(&pairs, infra::liquidity::AtBlock::Recent)
@@ -226,7 +226,7 @@ impl Order {
226226
}
227227

228228
/// Returns the token pairs to fetch liquidity for.
229-
fn liquidity_pairs(&self) -> Option<HashSet<liquidity::TokenPair>> {
229+
fn token_liquidity(&self) -> Option<HashSet<liquidity::TokenPair>> {
230230
liquidity::TokenPair::try_new(self.tokens.sell(), self.tokens.buy())
231231
.map(|pair| iter::once(pair).collect())
232232
.ok()

crates/shared/src/order_validation.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ use {
4646
quote::{OrderQuoteSide, QuoteSigningScheme, SellAmount},
4747
signature::{self, Signature, SigningScheme, hashed_eip712_message},
4848
time,
49-
}, std::{sync::Arc, time::Duration}, tracing::instrument
49+
},
50+
std::{sync::Arc, time::Duration},
51+
tracing::instrument,
5052
};
5153

5254
#[cfg_attr(any(test, feature = "test-util"), mockall::automock)]
@@ -859,8 +861,7 @@ pub enum OrderValidToError {
859861
/// This also checks for orders selling wrapped native token for native token.
860862
fn has_same_buy_and_sell_token(order: &PreOrderData, native_token: &Address) -> bool {
861863
order.sell_token == order.buy_token
862-
|| (order.sell_token == *native_token
863-
&& order.buy_token == BUY_ETH_ADDRESS)
864+
|| (order.sell_token == *native_token && order.buy_token == BUY_ETH_ADDRESS)
864865
}
865866

866867
/// Retrieves the quote for an order that is being created and verify that its
@@ -1029,7 +1030,7 @@ mod tests {
10291030
signature_validator::MockSignatureValidating,
10301031
},
10311032
alloy::{
1032-
primitives::{Address, B160, U160, address},
1033+
primitives::{Address, U160, address},
10331034
providers::{Provider, ProviderBuilder, mock::Asserter},
10341035
},
10351036
ethcontract::web3::signing::SecretKeyRef,

0 commit comments

Comments
 (0)