1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00
squid-js/test/unit/__mocks__/Aquarius.mock.ts

21 lines
594 B
TypeScript
Raw Permalink Normal View History

2020-01-30 22:08:18 +01:00
import { Aquarius } from '../../../src/aquarius/Aquarius'
import { DDO } from '../../../src/ddo/DDO'
import DID from '../../../src/ocean/DID'
const ddoStore: Map<string, any> = new Map<string, any>()
2018-10-17 18:24:01 +02:00
2018-10-25 17:26:26 +02:00
export default class AquariusMock extends Aquarius {
2018-10-26 10:40:46 +02:00
public async getAccessUrl(accessToken: any, payload: any): Promise<string> {
2019-06-20 00:20:09 +02:00
return 'http://test/test'
2018-10-17 18:24:01 +02:00
}
public async storeDDO(ddo: DDO): Promise<DDO> {
ddoStore.set(ddo.id, ddo)
return ddo
}
2018-12-17 15:54:58 +01:00
public async retrieveDDO(did: DID): Promise<DDO> {
return ddoStore.get(did.getDid())
}
2018-10-17 18:24:01 +02:00
}