Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird type issue #95

Open
0xekez opened this issue Mar 7, 2023 · 1 comment
Open

Weird type issue #95

0xekez opened this issue Mar 7, 2023 · 1 comment

Comments

@0xekez
Copy link

0xekez commented Mar 7, 2023

While generating the schema for a query message that returns Option<cw_utils::Duration>, ts-codegen fails with:

contracts/cw-vesting/CwVesting.client.ts:25:31 - error TS2552: Cannot find name 'NullableDuration'. Did you mean 'Nullable_Duration'?

25   vestDuration: () => Promise<NullableDuration>;
                                 ~~~~~~~~~~~~~~~~

contracts/cw-vesting/CwVesting.client.ts:81:36 - error TS2552: Cannot find name 'NullableDuration'. Did you mean 'Nullable_Duration'?

81   vestDuration = async (): Promise<NullableDuration> => {
                                      ~~~~~~~~~~~~~~~~

It appears that it generates a type Nullable_Duration that is correct, and the uses a different one NullableDuration as the query return value. This CI job has a branch on which this fails. You can reproduce the issue by checking out that branch and running ts-codegen with just gen.

@pyramation
Copy link
Collaborator

thanks @0xekez — can you provide the schema?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants