Skip to content

Commit

Permalink
omit empty params in eth_blockNumber call
Browse files Browse the repository at this point in the history
  • Loading branch information
legobeat committed Nov 24, 2023
1 parent a33cffa commit 792d2ed
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
4 changes: 0 additions & 4 deletions src/PollingBlockTracker.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ describe('PollingBlockTracker', () => {
jsonrpc: '2.0' as const,
id: expect.any(Number),
method: 'eth_blockNumber' as const,
params: [],
skipCache: true,
},
expect.any(Function),
Expand Down Expand Up @@ -740,7 +739,6 @@ describe('PollingBlockTracker', () => {
jsonrpc: '2.0' as const,
id: expect.any(Number),
method: 'eth_blockNumber' as const,
params: [],
skipCache: true,
},
expect.any(Function),
Expand Down Expand Up @@ -1257,7 +1255,6 @@ describe('PollingBlockTracker', () => {
jsonrpc: '2.0' as const,
id: expect.any(Number),
method: 'eth_blockNumber' as const,
params: [],
skipCache: true,
},
expect.any(Function),
Expand Down Expand Up @@ -2018,7 +2015,6 @@ describe('PollingBlockTracker', () => {
jsonrpc: '2.0' as const,
id: expect.any(Number),
method: 'eth_blockNumber' as const,
params: [],
skipCache: true,
},
expect.any(Function),
Expand Down
3 changes: 1 addition & 2 deletions src/PollingBlockTracker.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { SafeEventEmitterProvider } from '@metamask/eth-json-rpc-provider';
import SafeEventEmitter from '@metamask/safe-event-emitter';
import type { JsonRpcRequest } from '@metamask/utils';
import type { Json, JsonRpcRequest } from '@metamask/utils';

Check failure on line 3 in src/PollingBlockTracker.ts

View workflow job for this annotation

GitHub Actions / Build, Lint, and Test (16.x)

'Json' is defined but never used

Check failure on line 3 in src/PollingBlockTracker.ts

View workflow job for this annotation

GitHub Actions / Build, Lint, and Test (18.x)

'Json' is defined but never used
import getCreateRandomId from 'json-rpc-random-id';
import pify from 'pify';

Expand Down Expand Up @@ -287,7 +287,6 @@ export class PollingBlockTracker
jsonrpc: '2.0',
id: createRandomId(),
method: 'eth_blockNumber',
params: [],
};
if (this._setSkipCacheFlag) {
req.skipCache = true;
Expand Down

0 comments on commit 792d2ed

Please sign in to comment.