Files
api/docs/rpc-provider/classes/_mock_index_.mock.md
T
2019-01-16 09:11:25 +00:00

4.0 KiB

A mock provider mainly used for testing. returns: The mock provider

Hierarchy

Mock

Implements

Constructors

constructor

⊕ new Mock(): Mock

Defined in mock/index.ts:68

Returns: Mock


Properties

isUpdating

● isUpdating: boolean = true

Defined in mock/index.ts:43


subscriptions

● subscriptions: MockState$Subscriptions = SUBSCRIPTIONS.reduce((subs, name) => { subs[name] = { callbacks: {}, lastValue: null };

return subs;

}, ({} as MockState$Subscriptions))

Defined in mock/index.ts:57


Accessors

hasSubscriptions

gethasSubscriptions(): boolean

Defined in mock/index.ts:74

Returns: boolean


Methods

isConnected

▸ isConnected(): boolean

Implementation of ProviderInterface.isConnected

Defined in mock/index.ts:78

Returns: boolean


on

▸ on(type: ProviderInterface$Emitted, sub: ProviderInterface$EmitCb): void

Implementation of ProviderInterface.on

Defined in mock/index.ts:82

Parameters:

Name Type
type ProviderInterface$Emitted
sub ProviderInterface$EmitCb

Returns: void


send

▸ send(method: string, params: Array<any>): Promise<any>

Implementation of ProviderInterface.send

Defined in mock/index.ts:86

Parameters:

Name Type
method string
params Array<any>

Returns: Promise<any>


subscribe

▸ subscribe(type: string, method: string, ...params: Array<any>): Promise<number>

Defined in mock/index.ts:94

Parameters:

Name Type
type string
method string
Rest params Array<any>

Returns: Promise<number>


unsubscribe

▸ unsubscribe(type: string, method: string, id: number): Promise<boolean>

Implementation of ProviderInterface.unsubscribe

Defined in mock/index.ts:114

Parameters:

Name Type
type string
method string
id number

Returns: Promise<boolean>