diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index ca1dcc1..2f20666 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -21,7 +21,7 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.59.0 + toolchain: 1.79.0 target: wasm32-unknown-unknown override: true diff --git a/.github/workflows/licenses.yml b/.github/workflows/licenses.yml index eeac019..0fa89cb 100644 --- a/.github/workflows/licenses.yml +++ b/.github/workflows/licenses.yml @@ -26,7 +26,7 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.59.0 + toolchain: 1.79.0 target: wasm32-unknown-unknown override: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c2346d9..bf4f8a9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.65.0 + toolchain: 1.79.0 target: wasm32-unknown-unknown override: true diff --git a/Cargo.toml b/Cargo.toml index 8db8d9a..49a5160 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "apollo-utils" -version = "0.1.2" +version = "0.2.0" edition = "2021" license = "MPL-2.0" description = "Useful helper functions for writing CosmWasm smart contracts." @@ -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,