Files
ipfs-bch-wallet-service/test/unit/mocks/adapters/index.js
T

79 lines
1.1 KiB
JavaScript
Raw Normal View History

/*
Mocks for the Adapter library.
*/
class IpfsAdapter {
constructor () {
this.ipfs = {
files: {
stat: () => {}
}
}
}
}
class IpfsCoordAdapter {
constructor () {
this.ipfsCoord = {
adapters: {
ipfs: {
connectToPeer: async () => {}
}
},
useCases: {
peer: {
sendPrivateMessage: () => {}
}
},
thisNode: {}
}
}
}
const ipfs = {
ipfsAdapter: new IpfsAdapter(),
2023-10-28 09:17:48 -07:00
ipfsCoordAdapter: new IpfsCoordAdapter(),
getStatus: async () => {},
getPeers: async () => {},
getRelays: async () => {}
}
ipfs.ipfs = ipfs.ipfsAdapter.ipfs
2021-07-10 09:57:25 -07:00
const localdb = {
Users: class Users {
static findById () {}
2021-07-10 21:08:00 -07:00
static find () {}
static findOne () {
return {
validatePassword: localdb.validatePassword
}
}
async save () {
return {}
}
generateToken () {
return '123'
}
toJSON () {
return {}
}
async remove () {
return true
}
2021-07-13 08:57:57 -07:00
async validatePassword () {
return true
}
2021-07-10 21:08:00 -07:00
},
validatePassword: () => {
return true
2021-07-10 09:57:25 -07:00
}
}
2022-09-08 08:58:39 -07:00
export default { ipfs, localdb };