Skip to content

Commit

Permalink
Merge branch 'pr/cw-orch-interface' into improvements/cw-abc
Browse files Browse the repository at this point in the history
  • Loading branch information
ismellike committed Sep 18, 2024
2 parents 5631670 + b3b2ce7 commit a539980
Show file tree
Hide file tree
Showing 19 changed files with 149 additions and 324 deletions.
415 changes: 115 additions & 300 deletions Cargo.lock

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ integer-sqrt = "0.1.5"
integer-cbrt = "0.1.2"
once_cell = "1.18"
omniflix-std = "0.1.8"
osmosis-std = "0.20.1"
osmosis-std = "0.25.0"
osmosis-std-derive = "0.20.1"
osmosis-test-tube = "20.1.2"
osmosis-test-tube = "25.0.0"
proc-macro2 = "1.0"
prost = { version = "=0.12.3", features = ["prost-derive"] }
prost-types = { version = "=0.12.3", default-features = false }
prost-derive = "=0.12.3"
prost = { version = "0.12.3", features = ["prost-derive"] }
prost-types = { version = "0.12.3", default-features = false }
prost-derive = "0.12.3"
rust_decimal = "1.14.3"
quote = "1.0"
rand = "0.8"
Expand All @@ -88,7 +88,7 @@ test-context = "0.1"
thiserror = { version = "1.0" }
wynd-utils = "0.4"
cw-orch = "0.24.1"
tokio = "=1.38.1"
tokio = "1.40.0"

# One commit ahead of version 0.3.0. Allows initialization with an
# optional owner.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ fn burn_more_than_balance_should_fail_and_not_deduct_allowance() {
assert_eq!(
err,
RunnerError::ExecuteError {
msg: format!("failed to execute message; message index: 0: dispatch: submessages: {balance}{denom} is smaller than {burn_amount}{denom}: insufficient funds")
msg: format!("failed to execute message; message index: 0: dispatch: submessages: spendable balance {balance}{denom} is smaller than {burn_amount}{denom}: insufficient funds")
}
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ fn set_denom_metadata_by_contract_owner_should_work() {
display: "sthb".to_string(),
name: "Stable Thai Baht".to_string(),
symbol: "STHB".to_string(),
uri: String::default(),
uri_hash: String::default(),
};
env.cw_tokenfactory_issuer
.set_denom_metadata(metadata, owner)
Expand Down Expand Up @@ -64,6 +66,8 @@ fn set_denom_metadata_by_contract_non_owner_should_fail() {
display: "sthb".to_string(),
name: "Stable Thai Baht".to_string(),
symbol: "STHB".to_string(),
uri: String::default(),
uri_hash: String::default(),
};

// Set denom metadata
Expand Down Expand Up @@ -108,6 +112,8 @@ fn set_denom_metadata_with_base_denom_unit_should_overides_default_base_denom_un
display: "sthb".to_string(),
name: "Stable Thai Baht".to_string(),
symbol: "STHB".to_string(),
uri: String::default(),
uri_hash: String::default(),
};

// Set denom metadata
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ impl TokenfactoryIssuer {
code_id,
&instantiate_msg,
Some(&signer.address()),
None,
Some("cw_tokenfactory_issuer"),
&[token_creation_fee],
signer,
)?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ fn test_full_integration_with_factory() {
// Error is insufficient funds as no funds were sent
assert_eq!(
RunnerError::ExecuteError {
msg: "failed to execute message; message index: 0: dispatch: submessages: 0uosmo is smaller than 1000uosmo: insufficient funds".to_string()
msg: "failed to execute message; message index: 0: dispatch: submessages: spendable balance is smaller than 1000uosmo: insufficient funds".to_string()
},
err
);
Expand Down
5 changes: 4 additions & 1 deletion contracts/voting/dao-voting-token-staked/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,8 @@ pub fn reply(deps: DepsMut, env: Env, msg: Reply) -> Result<Response, ContractEr
// If metadata, set it by calling the contract
#[cfg(any(
feature = "osmosis_tokenfactory",
feature = "cosmwasm_tokenfactory"
feature = "cosmwasm_tokenfactory",
feature = "kujira_tokenfactory"
))]
if let Some(metadata) = token.metadata {
// The first denom_unit must be the same as the tf and base denom.
Expand Down Expand Up @@ -663,6 +664,8 @@ pub fn reply(deps: DepsMut, env: Env, msg: Reply) -> Result<Response, ContractEr
display: metadata.display,
name: metadata.name,
symbol: metadata.symbol,
uri: String::default(),
uri_hash: String::default(),
},
})?,
funds: vec![],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ impl<'a> TokenVotingContract<'a> {
code_id,
&instantiate_msg,
Some(&signer.address()),
None,
Some("token_voting"),
&[],
signer,
)?
Expand Down Expand Up @@ -398,7 +398,7 @@ impl<'a> TokenVotingContract<'a> {
code_id,
&instantiate_msg,
Some(&signer.address()),
None,
Some("token_voting_contract"),
&[],
signer,
)?
Expand Down
2 changes: 2 additions & 0 deletions packages/cw-tokenfactory-types/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ mod tokenfactory_msg {
display: metadata.display,
name: metadata.name,
symbol: metadata.symbol,
uri: metadata.uri,
uri_hash: metadata.uri_hash,
}),
}
}
Expand Down
3 changes: 3 additions & 0 deletions packages/dao-testing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ pub mod contracts;
#[cfg(not(target_arch = "wasm32"))]
pub use tests::*;

// Integration tests using an actual chain binary, requires
// the "test-tube" feature to be enabled
// cargo test --features test-tube
#[cfg(not(target_arch = "wasm32"))]
#[cfg(feature = "test-tube")]
pub mod test_tube;
2 changes: 1 addition & 1 deletion packages/dao-testing/src/test_tube/cw4_group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl<'a> Cw4Group<'a> {
code_id,
&instantiate_msg,
Some(&signer.address()),
None,
Some("cw4_group"),
&[],
signer,
)?
Expand Down
2 changes: 1 addition & 1 deletion packages/dao-testing/src/test_tube/cw721_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl<'a> Cw721Base<'a> {
code_id,
&instantiate_msg,
Some(&signer.address()),
None,
Some("cw721_base"),
&[],
signer,
)?
Expand Down
2 changes: 1 addition & 1 deletion packages/dao-testing/src/test_tube/cw_admin_factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl<'a> CwAdminFactory<'a> {
code_id,
&InstantiateMsg { admin },
Some(&signer.address()),
None,
Some("cw_admin_factory"),
funds,
signer,
)?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl<'a> TokenfactoryIssuer<'a> {
code_id,
&instantiate_msg,
Some(&signer.address()),
None,
Some("cw_tokenfactory_issuer"),
&[token_creation_fee],
signer,
)?
Expand Down
2 changes: 1 addition & 1 deletion packages/dao-testing/src/test_tube/dao_dao_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl<'a> DaoCore<'a> {
code_id,
&instantiate_msg,
Some(&signer.address()),
None,
Some("dao_dao_core"),
funds,
signer,
)?
Expand Down
2 changes: 1 addition & 1 deletion packages/dao-testing/src/test_tube/dao_proposal_single.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl<'a> DaoProposalSingle<'a> {
code_id,
&instantiate_msg,
Some(&signer.address()),
None,
Some("dao_proposal_single"),
&[token_creation_fee],
signer,
)?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl<'a> CustomFactoryContract<'a> {
code_id,
&instantiate_msg,
Some(&signer.address()),
None,
Some("dao_test_custom_factory"),
&[token_creation_fee],
signer,
)?
Expand Down
2 changes: 1 addition & 1 deletion packages/dao-testing/src/test_tube/dao_voting_cw4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl<'a> DaoVotingCw4<'a> {
code_id,
&instantiate_msg,
Some(&signer.address()),
None,
Some("dao_voting_cw4"),
funds,
signer,
)?
Expand Down
4 changes: 0 additions & 4 deletions packages/dao-testing/src/test_tube/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
// and also, tarpaulin will not be able read coverage out of wasm binary anyway
#![cfg(not(tarpaulin))]

// Integration tests using an actual chain binary, requires
// the "test-tube" feature to be enabled
// cargo test --features test-tube

pub mod cw4_group;
pub mod cw721_base;
pub mod cw_abc;
Expand Down

0 comments on commit a539980

Please sign in to comment.