From 52ccdadf2615bc3b2b6b43587aa1402f73d7ce14 Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Tue, 6 Jun 2023 19:32:56 +0200 Subject: [PATCH] Changed format as per PR review --- CHANGELOG.md | 2 +- packages/std/src/coin.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index abdd813673..25ac5ad6ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,7 +34,7 @@ and this project adheres to - cosmwasm-vm: Add `.wasm` extension to stored wasm files ([#1686]). - cosmwasm-vm: Upgrade Wasmer to version 3.3.0. - cosmwasm-check: Update clap dependency to version 4 ([#1677]) -- cosmwasm-std: Coin uses `123ucosm` format for Debug as well as Display +- cosmwasm-std: Coin uses `Coin { 123 "ucosm" }` format for Debug as well as Display ([#1704]) [#1511]: https://github.com/CosmWasm/cosmwasm/issues/1511 diff --git a/packages/std/src/coin.rs b/packages/std/src/coin.rs index 3744e8ed1e..0838958efa 100644 --- a/packages/std/src/coin.rs +++ b/packages/std/src/coin.rs @@ -21,7 +21,7 @@ impl Coin { impl fmt::Debug for Coin { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}{}", self.amount, self.denom) + write!(f, "Coin {{ {} \"{}\" }}", self.amount, self.denom) } } @@ -245,6 +245,6 @@ mod tests { #[test] fn debug_coin() { let coin = Coin::new(123, "ucosm"); - assert_eq!(format!("{:?}", coin), "123ucosm"); + assert_eq!(format!("{:?}", coin), r#"Coin { 123 "ucosm" }"#); } }