From 9f38e16d9ba1d86d68af98a3732d471821baaa8b Mon Sep 17 00:00:00 2001 From: Sergey Ratiashvili Date: Mon, 11 Dec 2023 22:24:00 +0100 Subject: [PATCH 1/2] fix: burn must not be enum --- contracts/token/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/token/src/lib.rs b/contracts/token/src/lib.rs index 1259268d..f7c6768f 100644 --- a/contracts/token/src/lib.rs +++ b/contracts/token/src/lib.rs @@ -43,7 +43,7 @@ pub struct InstantiateMsg { #[cosmwasm_schema::cw_serde] pub enum ExecuteMsg { Mint { amount: Uint128, receiver: String }, - Burn, + Burn {}, } #[cosmwasm_schema::cw_serde] @@ -122,7 +122,7 @@ pub fn execute( match msg { ExecuteMsg::Mint { amount, receiver } => mint(deps, amount, receiver), - ExecuteMsg::Burn => burn(deps, info), + ExecuteMsg::Burn {} => burn(deps, info), } } From d361eaff36d4591013d1d7e7d4bd3bd7e43b33c8 Mon Sep 17 00:00:00 2001 From: Sergey Ratiashvili Date: Mon, 11 Dec 2023 22:27:35 +0100 Subject: [PATCH 2/2] fix: tests --- contracts/token/src/tests.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/contracts/token/src/tests.rs b/contracts/token/src/tests.rs index 86b61557..1e9eab52 100644 --- a/contracts/token/src/tests.rs +++ b/contracts/token/src/tests.rs @@ -234,7 +234,7 @@ fn burn_zero() { deps.as_mut(), mock_env(), mock_info("core", &[]), - crate::ExecuteMsg::Burn, + crate::ExecuteMsg::Burn {}, ) .unwrap_err(); assert_eq!( @@ -257,7 +257,7 @@ fn burn_multiple_coins() { deps.as_mut(), mock_env(), mock_info("core", &[coin(20, "coin1"), coin(10, "denom")]), - crate::ExecuteMsg::Burn, + crate::ExecuteMsg::Burn {}, ) .unwrap_err(); assert_eq!( @@ -280,7 +280,7 @@ fn burn_invalid_coin() { deps.as_mut(), mock_env(), mock_info("core", &[coin(20, "coin1")]), - crate::ExecuteMsg::Burn, + crate::ExecuteMsg::Burn {}, ) .unwrap_err(); assert_eq!( @@ -305,7 +305,7 @@ fn burn() { deps.as_mut(), mock_env(), mock_info("core", &[coin(140, "denom")]), - crate::ExecuteMsg::Burn, + crate::ExecuteMsg::Burn {}, ) .unwrap(); @@ -339,7 +339,7 @@ fn burn_stranger() { deps.as_mut(), mock_env(), mock_info("stranger", &[coin(160, "denom")]), - crate::ExecuteMsg::Burn, + crate::ExecuteMsg::Burn {}, ) .unwrap_err();