Skip to content

Commit

Permalink
Merge pull request #1451 from polywrap/fix-ethereum-provider-config
Browse files Browse the repository at this point in the history
fix: add polywrap infura provider to CLI test-env config
  • Loading branch information
dOrgJelli authored Dec 16, 2022
2 parents 91342a9 + fc1b8da commit 3cefe9b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 8 additions & 0 deletions packages/cli/src/lib/test-env/client-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ export function getTestEnvClientConfig(): Partial<PolywrapClientConfig> {
testnet: new Connection({
provider: ethProvider,
}),
mainnet: new Connection({
provider:
"https://mainnet.infura.io/v3/b00b2c2cc09c487685e9fb061256d6a6",
}),
goerli: new Connection({
provider:
"https://goerli.infura.io/v3/b00b2c2cc09c487685e9fb061256d6a6",
}),
},
}),
}),
Expand Down
8 changes: 4 additions & 4 deletions packages/js/plugins/ethereum/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,14 +442,14 @@ export class EthereumPlugin extends Module<EthereumPluginConfig> {
// This behavior is a consequence of how the ens-resolver uses the Ethereum plugin, always specifying the connection network name (e.g. mainnet)
if (
!connection?.node &&
this.env.connection &&
this.env.connection.networkNameOrChainId ===
this.env?.connection &&
this.env?.connection.networkNameOrChainId ===
connection?.networkNameOrChainId
) {
return this._connections.getConnection(this.env.connection);
return this._connections.getConnection(this.env?.connection);
}

return this._connections.getConnection(connection || this.env.connection);
return this._connections.getConnection(connection || this.env?.connection);
}
}

Expand Down

0 comments on commit 3cefe9b

Please sign in to comment.