1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-11-15 01:34:57 +01:00
market/tests/unit/__mocks__/@oceanprotocol/lib.ts

75 lines
1.5 KiB
TypeScript

import ddo from '../../__fixtures__/ddo'
const metadataCache = {
queryMetadata: () => {
return {
results: [] as any[],
totalResults: 1,
totalPages: 1
}
}
}
const libMock = {
MetadataStore: () => metadataCache,
DDO: () => ddo,
ocean: {
accounts: {
list: () => ['xxx', 'xxx']
},
metadataCache,
// compute: {
// status: (account: string) => {
// return [job]
// }
// },
assets: {
query: () => {
return {
results: [ddo] as any[],
page: 1,
total_pages: 1611,
total_results: 1611
}
},
resolve: () => null as any,
order: () => {
return {
next: () => null as any
}
},
consume: () => null as any,
getFreeWhiteList: () => Promise.resolve([])
},
versions: {
get: () =>
Promise.resolve({
squid: {
name: 'Squid-js',
status: 'Working'
},
metadataStore: {
name: 'MetadataStore',
status: 'Working'
},
provider: {
name: 'Provider',
network: 'Rinkeby',
status: 'Working',
contracts: {
hello: 'hello',
hello2: 'hello2'
}
},
status: {
ok: true,
network: true,
contracts: true
}
})
}
}
}
export default libMock