From 044554b58525d1677646a74119f86ea867a06d1e Mon Sep 17 00:00:00 2001 From: Richard Moore Date: Fri, 24 May 2019 15:31:30 -0400 Subject: [PATCH] Track per-provider JSON-RPC ID (#) --- packages/providers/src.ts/json-rpc-provider.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/providers/src.ts/json-rpc-provider.ts b/packages/providers/src.ts/json-rpc-provider.ts index c6a1297c1..971544dd7 100644 --- a/packages/providers/src.ts/json-rpc-provider.ts +++ b/packages/providers/src.ts/json-rpc-provider.ts @@ -211,6 +211,7 @@ export class JsonRpcProvider extends BaseProvider { readonly connection: ConnectionInfo; _pendingFilter: Promise; + _nextId: number; constructor(url?: ConnectionInfo | string, network?: Networkish) { errors.checkNew(new.target, JsonRpcProvider); @@ -257,6 +258,7 @@ export class JsonRpcProvider extends BaseProvider { this.connection = url; } + this._nextId = 42; } getSigner(addressOrIndex?: string | number): JsonRpcSigner { @@ -277,7 +279,7 @@ export class JsonRpcProvider extends BaseProvider { let request = { method: method, params: params, - id: 42, + id: (this._nextId++), jsonrpc: "2.0" };