ethereum-block-by-date icon indicating copy to clipboard operation
ethereum-block-by-date copied to clipboard

Bug in DefinitelyTyped definitions

Open supafreq opened this issue 3 years ago • 3 comments

None of the method return values are wrapped with Promise<...>, so my IDE yells at me that I'm using await unnecessarily.

supafreq avatar May 26 '22 22:05 supafreq

Could you please provide some code example?

monosux avatar Jun 06 '22 16:06 monosux

I'm getting this too!

screenshot-QrWZSJM2

Looks like the DefinitelyTyped typings sets the return type to EthDater.BlockResult, when it should be Promise<EthDater.BlockResult>.

This change in DefinitelyTyped should do it:

- getDate(date: MomentInput, after?: boolean, refresh?: boolean): EthDater.BlockResult;
+ getDate(date: MomentInput, after?: boolean, refresh?: boolean): Promise<EthDater.BlockResult>;

larskarbo avatar Jun 15 '22 09:06 larskarbo

Hi @larskarbo,

Thank you! Could you please submit needed changes to DefinitelyTyped?

monosux avatar Jun 15 '22 15:06 monosux