Skip to content

Commit

Permalink
Merge pull request #1801 from CosmWasm/1790-remove-workaround
Browse files Browse the repository at this point in the history
Upgrade bnum to 0.8.0
  • Loading branch information
chipshort authored Jul 27, 2023
2 parents c8491b8 + ed2d3f2 commit 2459730
Show file tree
Hide file tree
Showing 17 changed files with 29 additions and 47 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions contracts/burner/Cargo.lock

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

4 changes: 2 additions & 2 deletions contracts/crypto-verify/Cargo.lock

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

4 changes: 2 additions & 2 deletions contracts/cyberpunk/Cargo.lock

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

4 changes: 2 additions & 2 deletions contracts/floaty/Cargo.lock

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

4 changes: 2 additions & 2 deletions contracts/hackatom/Cargo.lock

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

4 changes: 2 additions & 2 deletions contracts/ibc-reflect-send/Cargo.lock

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

4 changes: 2 additions & 2 deletions contracts/ibc-reflect/Cargo.lock

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

4 changes: 2 additions & 2 deletions contracts/queue/Cargo.lock

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

4 changes: 2 additions & 2 deletions contracts/reflect/Cargo.lock

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

4 changes: 2 additions & 2 deletions contracts/staking/Cargo.lock

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

4 changes: 2 additions & 2 deletions contracts/virus/Cargo.lock

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

2 changes: 1 addition & 1 deletion packages/std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ sha2 = "0.10.3"
serde = { version = "1.0.103", default-features = false, features = ["derive", "alloc"] }
serde-json-wasm = { version = "0.5.0" }
thiserror = "1.0.26"
bnum = "0.7.0"
bnum = "0.8.0"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
cosmwasm-crypto = { path = "../crypto", version = "1.3.1" }
Expand Down
7 changes: 1 addition & 6 deletions packages/std/src/math/int256.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,12 +371,7 @@ impl From<Int256> for String {

impl fmt::Display for Int256 {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
// The inner type doesn't work as expected with padding, so we
// work around that. Remove this code when the upstream padding is fixed.
let unpadded = self.0.to_string();
let numeric = unpadded.strip_prefix('-').unwrap_or(&unpadded);

f.pad_integral(self >= &Self::zero(), "", numeric)
self.0.fmt(f)
}
}

Expand Down
7 changes: 1 addition & 6 deletions packages/std/src/math/int512.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,12 +404,7 @@ impl From<Int512> for String {

impl fmt::Display for Int512 {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
// The inner type doesn't work as expected with padding, so we
// work around that. Remove this code when the upstream padding is fixed.
let unpadded = self.0.to_string();
let numeric = unpadded.strip_prefix('-').unwrap_or(&unpadded);

f.pad_integral(self >= &Self::zero(), "", numeric)
self.0.fmt(f)
}
}

Expand Down
6 changes: 1 addition & 5 deletions packages/std/src/math/uint256.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,11 +420,7 @@ impl From<Uint256> for String {

impl fmt::Display for Uint256 {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
// The inner type doesn't work as expected with padding, so we
// work around that.
let unpadded = self.0.to_string();

f.pad_integral(true, "", &unpadded)
self.0.fmt(f)
}
}

Expand Down
6 changes: 1 addition & 5 deletions packages/std/src/math/uint512.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,11 +407,7 @@ impl From<Uint512> for String {

impl fmt::Display for Uint512 {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
// The inner type doesn't work as expected with padding, so we
// work around that.
let unpadded = self.0.to_string();

f.pad_integral(true, "", &unpadded)
self.0.fmt(f)
}
}

Expand Down

0 comments on commit 2459730

Please sign in to comment.