Skip to content

Commit

Permalink
fix walletconnect tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahZinsmeister committed Feb 24, 2022
1 parent ed0e5ae commit eeefaa1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/walletconnect/src/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { createWeb3ReactStoreAndActions } from '@web3-react/store'
import type { Actions, RequestArguments, Web3ReactStore } from '@web3-react/types'
import EventEmitter from 'node:events'
import { WalletConnect } from '.'
import { MockEIP1193Provider } from '../../eip1193/src/index.spec'

// necessary because walletconnect returns chainId as a number
class MockMockWalletConnectProvider extends MockEIP1193Provider {
public connector = new EventEmitter()

public eth_chainId_number = jest.fn((chainId?: string) =>
chainId === undefined ? chainId : Number.parseInt(chainId, 16)
)
Expand Down

0 comments on commit eeefaa1

Please sign in to comment.