Skip to content

Commit

Permalink
chore: export rpc method and fix test var
Browse files Browse the repository at this point in the history
  • Loading branch information
stanleyyconsensys committed Oct 11, 2024
1 parent 2ebf319 commit c80a3d8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions packages/get-starknet/src/rpcs/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './switch-network';
export * from './supported-specs';
export * from './request-chain-id';
6 changes: 3 additions & 3 deletions packages/get-starknet/src/rpcs/request-chain-id.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { mockWalletInit, createWallet, SepoliaNetwork } from '../__tests__/helpe
import { WalletRequestChainId } from './request-chain-id';

describe('WalletRequestChainId', () => {
it('switchs the network', async () => {
it('returns the current chain Id', async () => {
const wallet = createWallet();
mockWalletInit({ currentNetwork: SepoliaNetwork });

const walletSwitchStarknetChain = new WalletRequestChainId(wallet);
const result = await walletSwitchStarknetChain.execute();
const walletRequestChainId = new WalletRequestChainId(wallet);
const result = await walletRequestChainId.execute();

expect(result).toBe(SepoliaNetwork.chainId);
});
Expand Down
3 changes: 1 addition & 2 deletions packages/get-starknet/src/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { Provider } from 'starknet';

import { MetaMaskAccount } from './accounts';
import { RpcMethod, WalletIconMetaData } from './constants';
import { WalletSupportedSpecs, WalletSwitchStarknetChain } from './rpcs';
import { WalletRequestChainId } from './rpcs/request-chain-id';
import { WalletSupportedSpecs, WalletSwitchStarknetChain, WalletRequestChainId } from './rpcs';
import { MetaMaskSigner } from './signer';
import { MetaMaskSnap } from './snap';
import type { MetaMaskProvider, Network } from './type';
Expand Down

0 comments on commit c80a3d8

Please sign in to comment.