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

IDL doesn't generate correct types for enum args #1085

Closed
dominictwlee opened this issue Nov 30, 2021 · 2 comments
Closed

IDL doesn't generate correct types for enum args #1085

dominictwlee opened this issue Nov 30, 2021 · 2 comments
Labels
help wanted Extra attention is needed ts

Comments

@dominictwlee
Copy link
Contributor

dominictwlee commented Nov 30, 2021

The namespaced RPC method doesn't seem to create the correct type definitions for an enum arg type.

An enum is specified for instruction arg here:
https://github.com/dominictwlee/ts-enum-example-anchor/blob/master/programs/ts-enum-example/src/lib.rs#L8

However, it seems any type can be passed to that positional arg.
https://github.com/dominictwlee/ts-enum-example-anchor/blob/master/tests/ts-enum-example.ts#L13

I'm guessing the type definitions generated don't seem to enforce the correct type.

@armaniferrante armaniferrante added help wanted Extra attention is needed ts labels Nov 30, 2021
@Juici
Copy link
Contributor

Juici commented Apr 5, 2022

This should be fixed by #1726

@acheroncrypto
Copy link
Collaborator

Fixed in #2482.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed ts
Projects
None yet
Development

No branches or pull requests

4 participants