ignite / cli

Ignite is a CLI tool and hub designed for constructing Proof of Stake Blockchains rooted in Cosmos-SDK
https://ignite.com
Other
1.26k stars 549 forks source link

Frontend: Compilation error in generated React Hooks code #3554

Closed taryune closed 1 year ago

taryune commented 1 year ago

Describe the bug I got following error when I compile react frontend.

src/hooks/useIbcApplicationsTransferV1/index.ts:8:32: ERROR: Unexpected "**"

At react/src/hooks/useIbcApplicationsTransferV1/index.ts, There are some unnecessary string =** before type definitions

To reproduce Steps to reproduce the behavior:

  1. Scaffold new chain
  2. Scaffold React template with ignite s react
  3. Generate Typescript client and hooks with ignite g hooks
  4. Refer react/src/hooks/useIbcApplicationsTransferV1/index.ts
  5. There are some =** before type definitions
    
    export default function useIbcApplicationsTransferV1() {
    const client = useClient();
    const QueryDenomTrace = (hash=**: string,  options: any) => {
    const key = { type: 'QueryDenomTrace',  hash=** };    
    return useQuery([key], () => {
      const { hash=** } = key
      return  client.IbcApplicationsTransferV1.query.queryDenomTrace(hash=**).then( res => res.data );
    }, options);
    }


**What version are you using?**
Ignite CLI version:             v0.27.1
Ignite CLI build date:          2023-06-13T13:42:09Z
Ignite CLI source hash:         4acd1f185afb6d8d1a837e54f04c091121cfae01
Ignite CLI config version:      v1
Cosmos SDK version:             v0.47.3
Your OS:                        darwin
Your arch:                      arm64
Your Node.js version:           v18.16.0
Your go version:                go version go1.20.4 darwin/arm64
clockworkgr commented 1 year ago

This is related to the following change in ibc-go:

https://github.com/cosmos/ibc-go/commit/002b2661649d2d85431ebf2e8d2c455193a7f174

@ilgooz / @jeronimoalbi we need to modify the relevant analysis code...Should we do it as a hotfix (if possible) or as part of the analysis refactor ?