From b460aca049d62d3f2c3413b4d819ec606cb4feda Mon Sep 17 00:00:00 2001 From: ApolloGie Date: Tue, 13 Aug 2024 23:50:16 -0500 Subject: [PATCH] fix: bump apollo-cw-asset --- Cargo.toml | 4 ++-- src/assets.rs | 10 +++++----- src/macros.rs | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8db8d9a..a83bdc7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,10 +14,10 @@ keywords = ["cosmwasm", "smart-contract", "cw20", "apollo", "web3"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -cosmwasm-std = "1.2.1" +cosmwasm-std = "1.5.5" cosmwasm-schema = "1.2.1" cw20 = "1.0.1" -apollo-cw-asset = "0.1.0" +apollo-cw-asset = { git = "https://github.com/apollodao/apollo-cw-asset.git", rev = "7df6fc38ebcedd2408192858f8af403ef8683d0f" } regex = "1.9.5" [dev-dependencies] diff --git a/src/assets.rs b/src/assets.rs index 2ce87dd..758bf49 100644 --- a/src/assets.rs +++ b/src/assets.rs @@ -1,6 +1,6 @@ use apollo_cw_asset::{Asset, AssetInfo, AssetList}; use cosmwasm_std::{ - attr, to_binary, Addr, Api, Coin, CosmosMsg, Env, Event, MessageInfo, Response, StdError, + attr, to_json_binary, Addr, Api, Coin, CosmosMsg, Env, Event, MessageInfo, Response, StdError, StdResult, WasmMsg, }; use cw20::{Cw20Coin, Cw20ExecuteMsg}; @@ -232,7 +232,7 @@ pub fn increase_allowance_msgs( .map(|x| { Ok(CosmosMsg::Wasm(WasmMsg::Execute { contract_addr: x.address, - msg: to_binary(&Cw20ExecuteMsg::IncreaseAllowance { + msg: to_json_binary(&Cw20ExecuteMsg::IncreaseAllowance { spender: recipient.to_string(), amount: x.amount, expires: Some(cw20::Expiration::AtHeight(env.block.height + 1)), @@ -253,7 +253,7 @@ mod tests { use cosmwasm_std::ReplyOn::Never; use cosmwasm_std::StdError::GenericErr; use cosmwasm_std::WasmMsg::Execute; - use cosmwasm_std::{to_binary, Addr, Coin, SubMsg, Uint128}; + use cosmwasm_std::{to_json_binary, Addr, Coin, SubMsg, Uint128}; use cw20::{Cw20ExecuteMsg, Expiration}; use test_case::test_case; @@ -317,7 +317,7 @@ mod tests { id: 0, msg: Wasm(Execute { contract_addr: String::from("apollo"), - msg: to_binary( + msg: to_json_binary( &(Cw20ExecuteMsg::TransferFrom { owner: String::from("addr"), recipient: String::from("cosmos2contract"), @@ -572,7 +572,7 @@ mod tests { CosmosMsg::Wasm(WasmMsg::Execute { contract_addr: "cw20".to_string(), funds: vec![], - msg: to_binary(&Cw20ExecuteMsg::IncreaseAllowance { + msg: to_json_binary(&Cw20ExecuteMsg::IncreaseAllowance { spender: spender.to_string(), amount: Uint128::new(200), expires: Some(Expiration::AtHeight(env.block.height + 1)), diff --git a/src/macros.rs b/src/macros.rs index 7347e41..29dcc23 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -31,7 +31,7 @@ macro_rules! contract_helper { msg: impl Into<$execute_msg>, funds: Vec, ) -> cosmwasm_std::StdResult { - let msg = cosmwasm_std::to_binary(&msg.into())?; + let msg = cosmwasm_std::to_json_binary(&msg.into())?; Ok(cosmwasm_std::WasmMsg::Execute { contract_addr: self.addr().into(), msg,