Skip to content

Commit

Permalink
Fix types: returnTransactionObjects param value affects resolve type (#…
Browse files Browse the repository at this point in the history
…4911) (#5000)

* returnTransactionObjects val affects resolve type

Co-authored-by: wbt <wbt@users.noreply.github.com>
  • Loading branch information
jdevcs and wbt authored May 4, 2022
1 parent 69c0b1a commit 7c4f1a5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ Released with 1.0.0-beta.37 code base.
- Fix web3-core-method throws on `f.call = this.call` when intrinsic is frozen (#4918) (#4938)
- Fix static tuple encoding (#4673) (#4884)
- Fix bug in handleRevert logic for eth_sendRawTransaction (#4902)
- Fix resolve type of getBlock function (#4911)

### Changed
- Replace deprecated String.prototype.substr() (#4855)
Expand Down
13 changes: 11 additions & 2 deletions packages/web3-eth/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,15 +218,24 @@ export class Eth {
getBlock(blockHashOrBlockNumber: BlockNumber | string): Promise<BlockTransactionString>;
getBlock(
blockHashOrBlockNumber: BlockNumber | string,
returnTransactionObjects: boolean
returnTransactionObjects: false
): Promise<BlockTransactionString>;
getBlock(
blockHashOrBlockNumber: BlockNumber | string,
returnTransactionObjects: true
): Promise<BlockTransactionObject>;
getBlock(
blockHashOrBlockNumber: BlockNumber | string,
callback?: (error: Error, block: BlockTransactionString) => void
): Promise<BlockTransactionString>;
getBlock(
blockHashOrBlockNumber: BlockNumber | string,
returnTransactionObjects: boolean,
returnTransactionObjects: false,
callback?: (error: Error, block: BlockTransactionString) => void
): Promise<BlockTransactionString>;
getBlock(
blockHashOrBlockNumber: BlockNumber | string,
returnTransactionObjects: true,
callback?: (error: Error, block: BlockTransactionObject) => void
): Promise<BlockTransactionObject>;

Expand Down

0 comments on commit 7c4f1a5

Please sign in to comment.