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

Fix TS promise error types in web3-eth #3496

Closed
cgewecke opened this issue Apr 30, 2020 · 0 comments · Fixed by #3504
Closed

Fix TS promise error types in web3-eth #3496

cgewecke opened this issue Apr 30, 2020 · 0 comments · Fixed by #3504
Labels
1.x 1.0 related issues Bug Addressing a bug Types Incorrect or missing types

Comments

@cgewecke
Copy link
Collaborator

cgewecke commented Apr 30, 2020

The pattern used in that file looks like:

https://github.com/ethereum/web3.js/blob/3e10668745ddbff8c785351f36754343ec680acf/packages/web3-eth/types/index.d.ts#L295-L298

This passes Web3's types tests but as reported in comment #3248 comment, TS complains when making an assignment like:

// Does not compile
const a: TransactionReceipt = await sendTransaction(...) 

// This is ok though..
const a = await sendTransaction(...) 

There's a guide to defining Promise error types here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x 1.0 related issues Bug Addressing a bug Types Incorrect or missing types
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant