MockStorage

@requestnetwork/request-client.jsGlobals"mock-storage"MockStorage

Storage layer implemented with in-memory hashmap, to be used for testing.

Hierarchy

  • MockStorage

Implements

  • IStorage

Index

Properties

Methods

Properties

Private data

data: Map‹string, object› = new Map()

Defined in request-client.js/src/mock-storage.ts:10


Private forceEmitError

forceEmitError: boolean = false

Defined in request-client.js/src/mock-storage.ts:16

Methods

_getStatus

_getStatus(detailed?: undefined | false | true): Promise‹any›

Defined in request-client.js/src/mock-storage.ts:138

Gets information

Parameters:

NameTypeDescription
detailed?undefined | false | trueif true get the list of files hash

Returns: Promise‹any›


_ipfsAdd

_ipfsAdd(content: string): Promise‹IIpfsMeta›

Defined in request-client.js/src/mock-storage.ts:22

Parameters:

NameType
contentstring

Returns: Promise‹IIpfsMeta›


_makeNextAppendFailInsteadOfConfirmed

_makeNextAppendFailInsteadOfConfirmed(): void

Defined in request-client.js/src/mock-storage.ts:151

Returns: void


append

append(content: string): Promise‹IAppendResult›

Defined in request-client.js/src/mock-storage.ts:42

Parameters:

NameType
contentstring

Returns: Promise‹IAppendResult›


getData

getData(): Promise‹IEntriesWithLastTimestamp›

Defined in request-client.js/src/mock-storage.ts:110

Returns: Promise‹IEntriesWithLastTimestamp›


getIgnoredData

getIgnoredData(): Promise‹IEntry[]›

Defined in request-client.js/src/mock-storage.ts:129

Returns: Promise‹IEntry[]›


initialize

initialize(): Promise‹void›

Defined in request-client.js/src/mock-storage.ts:18

Returns: Promise‹void›


read

read(id: string): Promise‹IEntry›

Defined in request-client.js/src/mock-storage.ts:87

Parameters:

NameType
idstring

Returns: Promise‹IEntry›


readMany

readMany(ids: string[]): Promise‹IEntry[]›

Defined in request-client.js/src/mock-storage.ts:106

Parameters:

NameType
idsstring[]

Returns: Promise‹IEntry[]›