Skip to content

Commit

Permalink
fixing float cw issue
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmitry-lahoda committed Apr 9, 2024
1 parent 7a391b5 commit ba596bc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 21 deletions.
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ env_logger = { version = "0.11.3", default-features = false, features = [
"unstable-kv",
] }
hex = { version = "^0.4.3", default-features = false }
num = { version = "^0.4.1", default-features = false }
enumn = { version = "0.1.13" }
prost-build = { version = "^0.12.2" }
bech32 = { version = "^0.11.0", default-features = false }
Expand All @@ -86,9 +85,13 @@ cw-storage-plus = { version = "^1.2.0", features = [
"iterator",
], default-features = false }
itertools = { version = "^0.12.1", default-features = false }
num-integer = { version = "^0.1.46", default-features = false }
cw-multi-test = {version = "^1.0.0", default-features = false}
num-rational = {git = "https://github.com/dzmitry-lahoda-forks/num-rational.git", branch = "dz/1", default-features = false}

num-integer = { version = "^0.1.46", default-features = false }
num-rational = {git = "https://github.com/dzmitry-lahoda-forks/num-rational.git", rev = "719b4dbe0afd69b98f5875e3bdf936b9df822522", default-features = false}
num-traits = { version = "^0.2.18", default-features = false }
num = { version = "^0.4.1", default-features = false }


ibc-proto = { version = "^0.42.2", default-features = false }
serde-json-wasm = { version = "^1.0.1", default-features = false }
Expand Down Expand Up @@ -126,7 +129,7 @@ bip32 = { version = "^0.5.1", default-features = false, features = [
] }
prost-types = { version = "^0.12.3", default-features = false }
sha2 = { version = "^0.10.8", default-features = false }
num-traits = { version = "^0.2.17", default-features = false }

thiserror = { version = "^1.0.50", default-features = false, package = "thiserror-core" }
# no XCM until it has decent support for cosmwasm and wasm32 std https://github.com/paritytech/polkadot-sdk/pull/1454
# xcm = { version = "^5.0.0", default-features = false, package = "staging-xcm" }
Expand Down
11 changes: 0 additions & 11 deletions crates/cvm/src/asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,17 +179,6 @@ impl Amount {
// with rounding to reduce or reduce down part up to some seven bit parts
pub const MAX_PARTS: u64 = 1_000_000_000_000_000_000;

#[cfg(feature = "native")]
pub fn try_floor_ratio(value: Ratio<u128>) -> Result<Self, ArithmeticError> {
if value < 0.0 || value.is_nan() {
Err(ArithmeticError::Underflow)
} else if value > u128::MAX {
Err(ArithmeticError::Underflow)
} else {
Ok((value as u128).into())
}
}

pub const fn new(intercept: u128, slope: u64) -> Self {
Self {
intercept: Displayed(intercept),
Expand Down

0 comments on commit ba596bc

Please sign in to comment.