Skip to main content

Class: MockConnector

TestUtils.MockConnector

Summary

An interface implemented by EthersModalConnector in addition to AbstractConnector

Hierarchy

  • AbstractConnector

    MockConnector

Implements

Properties

provider

Protected provider: MockProvider

Defined in

src/helpers/test-utils/wrapper/MockConnector.ts:14


mockChainId

Protected mockChainId: number

Defined in

src/helpers/test-utils/wrapper/MockConnector.ts:15


mockSigner

Protected mockSigner: undefined | Signer

Defined in

src/helpers/test-utils/wrapper/MockConnector.ts:17


mockAccount

Protected mockAccount: undefined | string

Defined in

src/helpers/test-utils/wrapper/MockConnector.ts:18


spyResetModal

spyResetModal: SinonStub<[], void>

Defined in

src/helpers/test-utils/wrapper/MockConnector.ts:20


spySetModalTheme

spySetModalTheme: SinonStub<[_theme: "light" | "dark" | ThemeColors], void>

Defined in

src/helpers/test-utils/wrapper/MockConnector.ts:21


spyChangeSigner

spyChangeSigner: SinonStub<[_signer: Signer], Promise<void>>

Defined in

src/helpers/test-utils/wrapper/MockConnector.ts:22


spyActivate

spyActivate: SinonStub<any[], any>

Defined in

src/helpers/test-utils/wrapper/MockConnector.ts:23


spyDeactivate

spyDeactivate: SinonStub<any[], any>

Defined in

src/helpers/test-utils/wrapper/MockConnector.ts:24

Constructors

constructor

new MockConnector(provider)

Parameters

NameType
providerMockProvider

Overrides

AbstractConnector.constructor

Defined in

src/helpers/test-utils/wrapper/MockConnector.ts:26

Methods

loadWeb3Modal

loadWeb3Modal(): void

Returns

void

Implementation of

ICommonModalConnector.loadWeb3Modal

Defined in

src/helpers/test-utils/wrapper/MockConnector.ts:33


replaceWithSpies

replaceWithSpies(): void

Returns

void

Defined in

src/helpers/test-utils/wrapper/MockConnector.ts:38


hasCachedProvider

hasCachedProvider(): boolean

Returns

boolean

Implementation of

ICommonModalConnector.hasCachedProvider

Defined in

src/helpers/test-utils/wrapper/MockConnector.ts:44


getSigner

getSigner(): undefined | Signer

Returns

undefined | Signer

Implementation of

ICommonModalConnector.getSigner

Defined in

src/helpers/test-utils/wrapper/MockConnector.ts:48


setModalTheme

setModalTheme(_theme): void

Parameters

NameType
_theme"light" | "dark" | ThemeColors

Returns

void

Implementation of

ICommonModalConnector.setModalTheme

Defined in

src/helpers/test-utils/wrapper/MockConnector.ts:51


resetModal

resetModal(): void

Returns

void

Implementation of

ICommonModalConnector.resetModal

Defined in

src/helpers/test-utils/wrapper/MockConnector.ts:54


changeSigner

changeSigner(_signer): Promise<void>

Parameters

NameType
_signerSigner

Returns

Promise<void>

Implementation of

ICommonModalConnector.changeSigner

Defined in

src/helpers/test-utils/wrapper/MockConnector.ts:58


activate

activate(): Promise<ConnectorUpdate<string | number>>

Returns

Promise<ConnectorUpdate<string | number>>

Overrides

AbstractConnector.activate

Defined in

src/helpers/test-utils/wrapper/MockConnector.ts:66


getProvider

getProvider(): Promise<TEthersProvider | MockProvider>

Returns

Promise<TEthersProvider | MockProvider>

Overrides

AbstractConnector.getProvider

Defined in

src/helpers/test-utils/wrapper/MockConnector.ts:74


getChainId

getChainId(): Promise<number>

Returns

Promise<number>

Overrides

AbstractConnector.getChainId

Defined in

src/helpers/test-utils/wrapper/MockConnector.ts:78


getAccount

getAccount(): Promise<string>

Returns

Promise<string>

Overrides

AbstractConnector.getAccount

Defined in

src/helpers/test-utils/wrapper/MockConnector.ts:82


setMockAccount

setMockAccount(hardhatAccountIndex): Promise<string>

Parameters

NameType
hardhatAccountIndexnumber

Returns

Promise<string>

Defined in

src/helpers/test-utils/wrapper/MockConnector.ts:87


deactivate

deactivate(): void

Returns

void

Overrides

AbstractConnector.deactivate

Defined in

src/helpers/test-utils/wrapper/MockConnector.ts:92