Skip to content

Commit

Permalink
make eth_chainId comply with spec (#1310)
Browse files Browse the repository at this point in the history
* make eth_chainId comply with spec

* test
  • Loading branch information
nateReiners authored May 30, 2024
1 parent f74ba03 commit 354ca64
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/CoinbaseWalletProvider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('CoinbaseWalletProvider', () => {
test('handles request correctly', async () => {
const provider = createProvider();
const response1 = await provider.request({ method: 'eth_chainId' });
expect(response1).toBe(1);
expect(response1).toBe('0x1');
});

test('throws error when handling invalid request', async () => {
Expand Down
1 change: 1 addition & 0 deletions packages/wallet-sdk/src/CoinbaseWalletProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export class CoinbaseWalletProvider extends EventEmitter implements ProviderInte
};
switch (request.method) {
case 'eth_chainId':
return hexStringFromIntNumber(IntNumber(this.chain.id));
case 'net_version':
return this.chain.id;
case 'eth_accounts':
Expand Down

0 comments on commit 354ca64

Please sign in to comment.