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

Instantiating a contract object in TypeScript results in a compiler error for view and change methods #1020

Open
lantelyes opened this issue Oct 19, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@lantelyes
Copy link

lantelyes commented Oct 19, 2022

When instantiating a contract in typescript, the viewMethods and changeMethods are not accessable in the resulting object, this is due to Object.defineProperty not being allowed to definitely assign properties via the constructor. See here for reference: microsoft/TypeScript#42919

To reproduce: instantiate any contract in TypeScript with a view or change method provided in the options parameter then try to call it, you will get the TypeScript error Property "methodName" does not exist on type 'Contract'.

I'm willing to take this on, the fix is fairly straight forward.

@lantelyes lantelyes added the bug Something isn't working label Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog 🥶
Development

No branches or pull requests

1 participant