Skip to content

Commit

Permalink
fix: added decimal token holding amount range for BTC token (#2765)
Browse files Browse the repository at this point in the history
Co-authored-by: higherordertech <higherordertech>
  • Loading branch information
higherordertech committed May 28, 2024
1 parent 7a65cfc commit 796f58d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -653,12 +653,7 @@ mod tests {
Box::new(AssertionLogic::Item {
src: "$holding_amount".into(),
op: Op::GreaterEq,
dst: "1600".into()
}),
Box::new(AssertionLogic::Item {
src: "$holding_amount".into(),
op: Op::LessThan,
dst: "3000".into()
dst: "50".into()
})
]
}
Expand Down
5 changes: 4 additions & 1 deletion tee-worker/litentry/core/common/src/web3_token/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ impl TokenHoldingAmountRange for Web3TokenType {
Self::Mcrt => MRCT_AMOUNT_RANGE.to_vec(),

// Eth
Self::Eth => ETH_AMOUNT_RNAGE.to_vec(),
Self::Eth => ETH_AMOUNT_RANGE.to_vec(),

// Usdc
Self::Usdc => USDC_AMOUNT_RANGE.to_vec(),
Expand Down Expand Up @@ -316,6 +316,9 @@ impl TokenHoldingAmountRange for Web3TokenType {
// Inj
Self::Inj => INJ_AMOUNT_RANGE.to_vec(),

// Btc
Self::Btc => BTC_AMOUNT_RANGE.to_vec(),

_ => [0.0, 1.0, 50.0, 100.0, 200.0, 500.0, 800.0, 1200.0, 1600.0, 3000.0].to_vec(),
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

pub const MRCT_AMOUNT_RANGE: [f64; 6] = [0.0, 2_000.0, 10_000.0, 50_000.0, 150_000.0, 500_000.0];

pub const ETH_AMOUNT_RNAGE: [f64; 10] = [0.0, 0.01, 0.05, 0.2, 0.6, 1.2, 3.0, 8.0, 20.0, 50.0];
pub const ETH_AMOUNT_RANGE: [f64; 10] = [0.0, 0.01, 0.05, 0.2, 0.6, 1.2, 3.0, 8.0, 20.0, 50.0];
pub const USDC_AMOUNT_RANGE: [f64; 9] =
[0.0, 10.0, 30.0, 80.0, 200.0, 500.0, 1_000.0, 2_000.0, 5_000.0];
pub const ADA_AMOUNT_RANGE: [f64; 7] =
Expand Down Expand Up @@ -46,3 +46,5 @@ pub const IMX_AMOUNT_RANGE: [f64; 8] = [0.0, 10.0, 30.0, 80.0, 200.0, 500.0, 1_0
pub const CRO_AMOUNT_RANGE: [f64; 7] =
[0.0, 1_000.0, 5_000.0, 20_000.0, 50_000.0, 100_000.0, 300_000.0];
pub const INJ_AMOUNT_RANGE: [f64; 6] = [0.0, 1.0, 5.0, 20.0, 50.0, 80.0];
pub const BTC_AMOUNT_RANGE: [f64; 14] =
[0.0, 0.001, 0.1, 0.3, 0.6, 1.0, 2.0, 5.0, 10.0, 15.0, 25.0, 30.0, 40.0, 50.0];

0 comments on commit 796f58d

Please sign in to comment.