2020-06-30 19:38:02 +02:00
|
|
|
import ddo from '../../__fixtures__/ddo'
|
|
|
|
import job from '../../__fixtures__/job'
|
|
|
|
|
2020-07-14 13:01:24 +02:00
|
|
|
const metadataStore = {
|
2020-06-30 19:38:02 +02:00
|
|
|
queryMetadata: () => {
|
|
|
|
return {
|
|
|
|
results: [] as any[],
|
|
|
|
totalResults: 1,
|
|
|
|
totalPages: 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const squidMock = {
|
2020-07-14 13:01:24 +02:00
|
|
|
MetadataStore: () => metadataStore,
|
2020-06-30 19:38:02 +02:00
|
|
|
DDO: () => ddo,
|
|
|
|
ocean: {
|
|
|
|
accounts: {
|
|
|
|
list: () => ['xxx', 'xxx']
|
|
|
|
},
|
2020-07-14 13:01:24 +02:00
|
|
|
metadataStore,
|
2020-06-30 19:38:02 +02:00
|
|
|
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([])
|
|
|
|
},
|
|
|
|
keeper: {
|
|
|
|
conditions: {
|
|
|
|
accessSecretStoreCondition: {
|
|
|
|
getGrantedDidByConsumer: () => {
|
|
|
|
return {
|
|
|
|
find: Promise.resolve(
|
|
|
|
'did:op:e6fda48e8d814d5d9655645aac3c046cc87528dbc1a9449799e579d7b83d1360'
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
agreementStoreManager: {
|
|
|
|
getAgreement: (agreementId: string) =>
|
|
|
|
Promise.resolve({
|
|
|
|
did:
|
|
|
|
'did:op:e6fda48e8d814d5d9655645aac3c046cc87528dbc1a9449799e579d7b83d1360'
|
|
|
|
})
|
|
|
|
}
|
|
|
|
},
|
|
|
|
versions: {
|
|
|
|
get: () =>
|
|
|
|
Promise.resolve({
|
|
|
|
squid: {
|
|
|
|
name: 'Squid-js',
|
|
|
|
status: 'Working'
|
|
|
|
},
|
2020-07-14 13:01:24 +02:00
|
|
|
metadataStore: {
|
|
|
|
name: 'MetadataStore',
|
2020-06-30 19:38:02 +02:00
|
|
|
status: 'Working'
|
|
|
|
},
|
2020-07-14 13:01:24 +02:00
|
|
|
provider: {
|
|
|
|
name: 'Provider',
|
|
|
|
network: 'Rinkeby',
|
2020-06-30 19:38:02 +02:00
|
|
|
status: 'Working',
|
|
|
|
contracts: {
|
|
|
|
hello: 'hello',
|
|
|
|
hello2: 'hello2'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
status: {
|
|
|
|
ok: true,
|
|
|
|
network: true,
|
|
|
|
contracts: true
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default squidMock
|