Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cw20-wrapped cw-multi-test integration tests #4200

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
327 changes: 252 additions & 75 deletions cosmwasm/Cargo.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion cosmwasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ members = [
"packages/cw_transcode",
"contracts/wormhole-ibc",
"contracts/wormchain-ibc-receiver",
"contracts/ibc-translator"
"contracts/ibc-translator",
"contracts/mock-counter"
]

# Needed to prevent unwanted feature unification between normal builds and dev builds. See
Expand Down
6 changes: 6 additions & 0 deletions cosmwasm/contracts/cw20-wrapped/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,9 @@ cw2 = { version = "0.13.2" }
cw20 = { version = "0.13.2" }
cw20-base = { version = "0.13.2", features = ["library"] }
thiserror = { version = "1.0.31" }

[dev-dependencies]
cw-multi-test = "0.14"
# this is just used for testing cw20-wrapped's hook logic
counter = { path = "../mock-counter", features = ["interface"] }
anyhow = "1.0.40"
12 changes: 6 additions & 6 deletions cosmwasm/contracts/cw20-wrapped/src/contract.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use cosmwasm_std::{
to_binary, Binary, CosmosMsg, Deps, DepsMut, Env, MessageInfo, Response, StdError, StdResult,
Uint128, WasmMsg,
to_json_binary, Binary, CosmosMsg, Deps, DepsMut, Env, MessageInfo, Response, StdError,
StdResult, Uint128, WasmMsg,
};

#[cfg(not(feature = "library"))]
Expand Down Expand Up @@ -167,12 +167,12 @@ fn execute_update_metadata(
#[cfg_attr(not(feature = "library"), entry_point)]
pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult<Binary> {
match msg {
QueryMsg::WrappedAssetInfo {} => to_binary(&query_wrapped_asset_info(deps)?),
QueryMsg::WrappedAssetInfo {} => to_json_binary(&query_wrapped_asset_info(deps)?),
// inherited from cw20-base
QueryMsg::TokenInfo {} => to_binary(&query_token_info(deps)?),
QueryMsg::Balance { address } => to_binary(&query_balance(deps, address)?),
QueryMsg::TokenInfo {} => to_json_binary(&query_token_info(deps)?),
QueryMsg::Balance { address } => to_json_binary(&query_balance(deps, address)?),
QueryMsg::Allowance { owner, spender } => {
to_binary(&query_allowance(deps, owner, spender)?)
to_json_binary(&query_allowance(deps, owner, spender)?)
}
}
}
Expand Down
Loading
Loading