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

Support PartialEq on error #179

Closed
12 tasks done
ethanfrey opened this issue Dec 13, 2020 · 3 comments · Fixed by #253
Closed
12 tasks done

Support PartialEq on error #179

ethanfrey opened this issue Dec 13, 2020 · 3 comments · Fixed by #253
Assignees
Milestone

Comments

@ethanfrey
Copy link
Member

ethanfrey commented Dec 13, 2020

Note: this is a long background process. Let's update contracts one by one as we refactor them (a bit like updating them all to storage-plus)

With StdError::PartialEq implementation from CosmWasm/cosmwasm#662, we can replace lots of statements like:

        match err {
            ContractError::Unauthorized {} => {}
            e => panic!("Unexpected error: {}", e),
        }

with simpler statements like:

assert_eq!(ContractError::Unauthorized {}, err);

It requires #[derive(PartialEq)] on ContractError and the above-mentioned support for StdError

Contracts to update:

  • cw1-subkeys
  • cw1-whitelist
  • cw3-fixed-multisig
  • cw3-flex-multisig
  • cw4-group
  • cw4-stake
  • cw20-atomic-swap
  • cw20-base
  • cw20-bonding
  • cw20-escrow
  • cw20-staking
  • cw721-base
@ethanfrey ethanfrey added the blocked Waiting for something before we can start label Dec 13, 2020
@ethanfrey ethanfrey removed the blocked Waiting for something before we can start label Dec 16, 2020
@ethanfrey
Copy link
Member Author

This works now, and we just need to update the contract code to use it.
I will add a bunch of checkboxes and tick them off as I port the contract code (I did a few during other refactorings)

@ethanfrey ethanfrey self-assigned this Dec 21, 2020
@ethanfrey ethanfrey added this to the 0.6.0 milestone Feb 26, 2021
@maurolacy
Copy link
Contributor

maurolacy commented Mar 22, 2021

Are you still working on this, or should I take it from here?

Update: I'll start working from top to bottom items, in the list above. And, checking the item when starting.

@ethanfrey
Copy link
Member Author

Thanks for taking this over. I started but then left it. Your PR looks nice.

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 a pull request may close this issue.

2 participants