Skip to content

Commit 30c9ca4

Browse files
committed
move function into general v2
1 parent a13f920 commit 30c9ca4

1 file changed

Lines changed: 1 addition & 14 deletions

File tree

frontend/src/vanillaswap/pools_v2.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,7 @@ use alloy::primitives::{utils::parse_units,U256};
44
use crate::components::switch::{Switch, SwitchThumb};
55
use crate::metamask::uniswap_v2::{V2PairInfo, get_uniswap_v2_pairs};
66
use crate::wallet_context::use_wallet;
7-
use super::v2::use_v2_pools;
8-
9-
fn is_zero_or_empty(v: &Option<String>) -> bool {
10-
match v.as_deref() {
11-
None => true,
12-
Some("") => true,
13-
Some("0") => true,
14-
Some("0.0") => true,
15-
Some(s) => {
16-
// also handle cases like "0.0000"
17-
s.trim().parse::<f64>().map(|n| n == 0.0).unwrap_or(false)
18-
}
19-
}
20-
}
7+
use super::v2::{use_v2_pools, is_zero_or_empty};
218

229
#[component]
2310
pub fn PoolV2Pairs() -> Element {

0 commit comments

Comments
 (0)