Skip to content

Commit

Permalink
Track per-provider JSON-RPC ID (#)
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed May 24, 2019
1 parent 47d92ae commit 044554b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/providers/src.ts/json-rpc-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ export class JsonRpcProvider extends BaseProvider {
readonly connection: ConnectionInfo;

_pendingFilter: Promise<number>;
_nextId: number;

constructor(url?: ConnectionInfo | string, network?: Networkish) {
errors.checkNew(new.target, JsonRpcProvider);
Expand Down Expand Up @@ -257,6 +258,7 @@ export class JsonRpcProvider extends BaseProvider {
this.connection = url;
}

this._nextId = 42;
}

getSigner(addressOrIndex?: string | number): JsonRpcSigner {
Expand All @@ -277,7 +279,7 @@ export class JsonRpcProvider extends BaseProvider {
let request = {
method: method,
params: params,
id: 42,
id: (this._nextId++),
jsonrpc: "2.0"
};

Expand Down

0 comments on commit 044554b

Please sign in to comment.