Skip to content

Commit

Permalink
mock contract addr ref
Browse files Browse the repository at this point in the history
  • Loading branch information
tsilva-figure committed Jul 8, 2022
1 parent 64c1a23 commit 3ca8746
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ mod tests {
use cosmwasm_std::coin;
use cosmwasm_std::testing::mock_env;
use cosmwasm_std::testing::mock_info;
use cosmwasm_std::testing::MOCK_CONTRACT_ADDR;
use cosmwasm_std::Addr;
use cosmwasm_std::Timestamp;

Expand Down Expand Up @@ -212,7 +213,7 @@ mod tests {
assert_eq!("investment_coin", marker_denom);
assert_eq!(200, coin.amount.u128());
assert_eq!("investment_coin", coin.denom);
assert_eq!("cosmos2contract", recipient.clone().into_string());
assert_eq!(MOCK_CONTRACT_ADDR, recipient.clone().into_string());

// verify capital call is saved
assert_eq!(
Expand Down
11 changes: 9 additions & 2 deletions src/instantiate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ mod tests {
use crate::msg::QueryMsg;
use crate::msg::Terms;
use crate::query::query;
use cosmwasm_std::testing::MOCK_CONTRACT_ADDR;
use cosmwasm_std::testing::{mock_env, mock_info};
use cosmwasm_std::{from_binary, Addr};
use provwasm_mocks::mock_dependencies;
Expand Down Expand Up @@ -162,8 +163,14 @@ mod tests {
let terms: Terms = from_binary(&res).unwrap();
assert_eq!(0, terms.acceptable_accreditations.len());
assert_eq!(0, terms.other_required_tags.len());
assert_eq!("cosmos2contract.commitment", terms.commitment_denom);
assert_eq!("cosmos2contract.investment", terms.investment_denom);
assert_eq!(
format!("{}.commitment", MOCK_CONTRACT_ADDR),
terms.commitment_denom
);
assert_eq!(
format!("{}.investment", MOCK_CONTRACT_ADDR),
terms.investment_denom
);
assert_eq!("stable_coin", terms.capital_denom);
assert_eq!(10_000, terms.min_commitment.unwrap());
assert_eq!(100_000, terms.max_commitment.unwrap());
Expand Down
3 changes: 2 additions & 1 deletion src/subscribe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ mod tests {
use cosmwasm_std::testing::mock_env;
use cosmwasm_std::testing::mock_info;
use cosmwasm_std::testing::MockApi;
use cosmwasm_std::testing::MOCK_CONTRACT_ADDR;
use cosmwasm_std::to_binary;
use cosmwasm_std::Addr;
use cosmwasm_std::ContractResult;
Expand Down Expand Up @@ -585,7 +586,7 @@ mod tests {
assert_eq!("commitment_coin", marker_denom);
assert_eq!(200, coin.amount.u128());
assert_eq!("commitment_coin", coin.denom);
assert_eq!("cosmos2contract", recipient.clone().into_string());
assert_eq!(MOCK_CONTRACT_ADDR, recipient.clone().into_string());

let (to_address, funds) = send_args(msg_at_index(&res, 2));
assert_eq!("sub_1", to_address);
Expand Down

0 comments on commit 3ca8746

Please sign in to comment.