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

workshop subkey PR #62

Merged

Conversation

whalelephant
Copy link
Contributor

  • add test for contract name check
  • use whitelist init before set_contract_version to reset version on contract

@CLAassistant
Copy link

CLAassistant commented Aug 26, 2020

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@ethanfrey ethanfrey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution

@@ -344,6 +348,42 @@ mod tests {
}
}


#[test]
fn get_contract_version_works() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the testcase. This could be a bit shorter (simple init), but this works as well.

set_contract_version(&mut deps.storage, &version)?;
whitelist_init(deps, env, msg)
let result = whitelist_init(deps, env, msg);
if result.is_ok() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one, only set on success.

I guess

let result = whitelist_init(deps, env, msg)?;
set_contract_version(&mut deps.storage, &version)?;
Ok(result);

would be the same, but this works as well

@ethanfrey ethanfrey merged commit 2c9e794 into CosmWasm:master Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants