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

Enable strictFunctionTypes in tsconfig #1793

Open
davidyuk opened this issue Apr 21, 2023 · 0 comments
Open

Enable strictFunctionTypes in tsconfig #1793

davidyuk opened this issue Apr 21, 2023 · 0 comments
Milestone

Comments

@davidyuk
Copy link
Member

similar to #1706

The most significant problem after enabling this in the project is:

src/tx/builder/schema.ts:583:17 - error TS4109: Type arguments for 'SchemaTypes' circularly reference themselves.

583 type TxSchema = SchemaTypes<typeof txSchema>;
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/tx/builder/schema.ts:586:13 - error TS2456: Type alias 'TxUnpacked' circularly references itself.

586 export type TxUnpacked = TxSchema['TxUnpacked'];
                ~~~~~~~~~~

It is important to be compatible with this option because it is enabled by default in some environments, like VS code and ts-node. Currently, it breaks the sdk types in a way

        Object literal may only specify known properties, and 'payload' does not exist in type 'Omit<SpendOptions, "onNode" | "onAccount" | "onCompiler"> & Partial<Omit<SpendOptions, "onAccount"> & { onAccount: OnAccount; }>'.

13     await aeSdk.spend(1, aeSdk.address, { payload: 'ba_test' });
error TS2339: Property 'encodedTx' does not exist on type 'TxUnpacked & { tag: Tag.SignedTx; }'.
  Property 'encodedTx' does not exist on type 'TxUnpackedAccount1 & { tag: Tag.SignedTx; }'.

20   const { tag } = unpackTx(tx, Tag.SignedTx).encodedTx;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant