Skip to content

Commit

Permalink
fixed instantiate2 expect test
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSaso committed Jul 18, 2024
1 parent c9e9e9d commit 1a8b34b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion contracts/external/cw-admin-factory/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ pub fn instantiate2_contract(
salt,
};

let msg = SubMsg::reply_on_success(instantiate, INSTANTIATE_CONTRACT_REPLY_ID);
let msg = SubMsg::reply_on_success(instantiate, INSTANTIATE2_CONTRACT_REPLY_ID);
Ok(Response::default()
.add_attribute("action", "instantiate2_contract_with_self_admin")

Check warning on line 126 in contracts/external/cw-admin-factory/src/contract.rs

View check run for this annotation

Codecov / codecov/patch

contracts/external/cw-admin-factory/src/contract.rs#L115-L126

Added lines #L115 - L126 were not covered by tests
.add_submessage(msg))
Expand Down
7 changes: 3 additions & 4 deletions contracts/external/cw-admin-factory/src/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,18 +215,17 @@ fn test_set_self_admin_instantiate2() {
code_id: dao_dao_core_id,
label: "third".to_string(),
salt: salt.clone(),
expect: Some("wrong".to_string()),
expect: Some(cw_admin_factory.contract_addr.clone()),
},
&[],
&accounts[0],
)
.unwrap_err();

assert_eq!(
err,
RunnerError::ExecuteError {
msg: ContractError::UnexpectedContractAddress {
expected: "wrong".to_string(),
expected: cw_admin_factory.contract_addr.clone(),
actual: actual_addr.to_string(),
}
.to_string()
Expand All @@ -244,5 +243,5 @@ fn addr_canonicalize(prefix: &str, input: &str) -> CanonicalAddr {

fn addr_humanize(prefix: &str, canonical: &CanonicalAddr) -> Addr {
let encoded = encode(prefix, canonical.as_slice().to_base32(), Variant::Bech32).unwrap();
return Addr::unchecked(encoded);
Addr::unchecked(encoded)
}

0 comments on commit 1a8b34b

Please sign in to comment.