Skip to content

Commit

Permalink
fix: skip chainId eager load for RpcProvider initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
penovicp committed Nov 13, 2023
1 parent 2798298 commit 3bccc4d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/provider/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ export class RpcProvider implements ProviderInterface {
this.retries = retries || defaultOptions.retries;
this.headers = { ...defaultOptions.headers, ...headers };
this.blockIdentifier = blockIdentifier || defaultOptions.blockIdentifier;
this.chainId = chainId;
this.getChainId(); // internally skipped if chainId has value
this.chainId = chainId; // setting to a non-null value skips making a request in getChainId()
}

public fetch(method: string, params?: object, id: string | number = 0) {
Expand Down

0 comments on commit 3bccc4d

Please sign in to comment.