FR: Refactor CosmWasm messages to use distinct response types for each query #1277
Labels
O: maintainability
Objective: cause to ease modification, fault corrections and improve code understanding
Feature Summary
Currently, the contract API messages defined in the CosmWasm context return the same response type for each query type. This necessitates an aggregate struct with all fields optional. This approach is not ideal. Instead, the response types should be distinct and specific to each query type, similar to how they are defined in the 08-wasm module.
Proposal
I have created a wrapper contract around the
ics07-tendermint
context that implements this improved approach. Here are the types I used in that contract: response definitions and query definitions. Note that I am using this contract for other purposes (not in 08-wasm). (This repository successfully implements all of IBC-lite in CosmWasm, allowing for end-to-end packet passing with an ibc-go counterparty without any dependency on ibc-go.)By adopting distinct response types for each query, we can enhance clarity, maintainability, and adherence to best practices in the contract API.
The text was updated successfully, but these errors were encountered: