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:
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::PartialEqimplementation from CosmWasm/cosmwasm#662, we can replace lots of statements like:with simpler statements like:
It requires
#[derive(PartialEq)]onContractErrorand the above-mentioned support forStdErrorContracts to update: