Skip to content
This repository has been archived by the owner on Dec 10, 2020. It is now read-only.

Fix getBlockByHash tsc error #150

Merged
merged 2 commits into from
Oct 22, 2020
Merged

Fix getBlockByHash tsc error #150

merged 2 commits into from
Oct 22, 2020

Conversation

cgewecke
Copy link
Contributor

@cgewecke cgewecke commented Oct 20, 2020

Tiny fix to get tests and coverage running as a baseline for new PRs (#151, #152, #153) coming in....

The most recent ethereumjs-util update had stricter types and latest builds here were failing with:

Type 'false' is not assignable to type 'string | number | number[] | Buffer | BN | Uint8Array | TransformableToArray | TransformableToBuffer | null | undefined'.

89       let block = await this._chain.getBlock(toBuffer(blockHash))
                                                         ~~~~~~~~~

Proposed change corrects the types so they match the docs description of the params arg:

An array of two parameters: A block hash as the first argument and a boolean determining 
whether it returns full transaction objects or just the transaction hashes

(This project .gitignore's package-lock.json)

lib/rpc/modules/eth.ts Outdated Show resolved Hide resolved
@cgewecke cgewecke merged commit 7857b3e into master Oct 22, 2020
@cgewecke cgewecke deleted the fix/new-util-ts-error branch October 22, 2020 17:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants