From c80a3d88b2d6d08a040a7c976d233c32f960d6d9 Mon Sep 17 00:00:00 2001 From: stanleyyuen <102275989+stanleyyconsensys@users.noreply.github.com> Date: Fri, 11 Oct 2024 19:30:17 +0800 Subject: [PATCH] chore: export rpc method and fix test var --- packages/get-starknet/src/rpcs/index.ts | 1 + packages/get-starknet/src/rpcs/request-chain-id.test.ts | 6 +++--- packages/get-starknet/src/wallet.ts | 3 +-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/get-starknet/src/rpcs/index.ts b/packages/get-starknet/src/rpcs/index.ts index bb14057d..ae34160d 100644 --- a/packages/get-starknet/src/rpcs/index.ts +++ b/packages/get-starknet/src/rpcs/index.ts @@ -1,2 +1,3 @@ export * from './switch-network'; export * from './supported-specs'; +export * from './request-chain-id'; diff --git a/packages/get-starknet/src/rpcs/request-chain-id.test.ts b/packages/get-starknet/src/rpcs/request-chain-id.test.ts index c47e4f47..4294e9fe 100644 --- a/packages/get-starknet/src/rpcs/request-chain-id.test.ts +++ b/packages/get-starknet/src/rpcs/request-chain-id.test.ts @@ -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); }); diff --git a/packages/get-starknet/src/wallet.ts b/packages/get-starknet/src/wallet.ts index 49eb4c73..541e2d31 100644 --- a/packages/get-starknet/src/wallet.ts +++ b/packages/get-starknet/src/wallet.ts @@ -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';