Skip to content

Support PartialEq on error #179

@ethanfrey

Description

@ethanfrey

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions