Skip to content

Commit

Permalink
fix: introduce block identifier type
Browse files Browse the repository at this point in the history
Usage like `getBlock(undefined, 3003)` is very uncommon is JS.
Therefore I introduced an easy pattern to allow blockhash and blockid
  • Loading branch information
janek26 committed Feb 1, 2022
1 parent 3900296 commit 75599a9
Show file tree
Hide file tree
Showing 5 changed files with 11,633 additions and 6,734 deletions.
4 changes: 1 addition & 3 deletions __tests__/provider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('defaultProvider', () => {
).resolves.not.toThrow();
});
test('getBlock(blockHash=undefined, blockNumber=36657)', () => {
return expect(defaultProvider.getBlock(undefined, 36657)).resolves.not.toThrow();
return expect(defaultProvider.getBlock(36657)).resolves.not.toThrow();
});
test('getBlock(blockHash=undefined, blockNumber=null)', () => {
return expect(defaultProvider.getBlock()).resolves.not.toThrow();
Expand All @@ -34,7 +34,6 @@ describe('defaultProvider', () => {
return expect(
defaultProvider.getCode(
'0x01d1f307c073bb786a66e6e042ec2a9bdc385a3373bb3738d95b966d5ce56166',
undefined,
36663
)
).resolves.not.toThrow();
Expand All @@ -51,7 +50,6 @@ describe('defaultProvider', () => {
defaultProvider.getStorageAt(
'0x01d1f307c073bb786a66e6e042ec2a9bdc385a3373bb3738d95b966d5ce56166',
0,
undefined,
36663
)
).resolves.not.toThrow();
Expand Down
Loading

0 comments on commit 75599a9

Please sign in to comment.