hyperweb-io / hyperweb-io/ts-codegen

bug: ts-codegen fails to generate correct bindings

Open
#91 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
126
Forks
31
Avg merge
19m
Merged PRs (30d)
2

Description

### What is happening
Cw3 Fixed Multisig has `Vote` as both an `ExecuteMsg` and a `QueryMsg`:
* https://github.com/CosmWasm/cw-plus/blob/main/contracts/cw3-fixed-multisig/src/msg.rs#L29-L32
* https://github.com/CosmWasm/cw-plus/blob/main/contracts/cw3-fixed-multisig/src/msg.rs#L59-L60

When you generate the TS bindings for the Cw3 contract:
```
cosmwasm-ts-codegen
? [cmd] what do you want to do? generate
? [schema] which directory contains the the Rust contracts? ./schema
? [out] where is the output directory? ./ts
? [name] contract name? Cw3FixedMultisig
? [plugin] which plugins? client, message-composer
? [bundle] enable bundle? No
```
It ends up generating the bindings where the `vote` property on `Cw3FixedMultisigReadOnlyInterface` gets overridden by the `vote` property on `Cw3FixedMultisigInterface` with a different syntax.

### Expectation
The Cw3 contract is correct. `ts-codegen` should be able to correctly handle this edge case when the names across Execute and Query msgs might conflict.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running cosmwasm-ts-codegen with the Cw3 Fixed Multisig schema and the client and message-composer plugins, then inspect the generated Cw3FixedMultisigReadOnlyInterface and Cw3FixedMultisigInterface. Confirm that the ExecuteMsg and QueryMsg Vote definitions remain usable without one vote property overriding the other, and add coverage for this schema edge case if the project’s test location is identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, typescript
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.