Merge pull request #21 from Permissionless-Software-Foundation/ct-unstable

fix(ipfs-cood): Bumping to v6.1.2
This commit is contained in:
Chris Troutner
2021-08-23 16:38:06 -07:00
committed by GitHub
5 changed files with 9484 additions and 10832 deletions
+9457 -10816
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -27,8 +27,8 @@
"axios": "^0.21.1",
"bcryptjs": "^2.4.3",
"glob": "^7.1.6",
"ipfs": "0.54.4",
"ipfs-coord": "^5.0.0",
"ipfs": "0.55.4",
"ipfs-coord": "^6.1.2",
"jsonrpc-lite": "^2.2.0",
"jsonwebtoken": "^8.5.1",
"jwt-bch-lib": "^1.3.0",
+1 -1
View File
@@ -63,7 +63,7 @@ class IpfsCoordAdapter {
attachRPCRouter (router) {
try {
_this.ipfsCoord.privateLog = router
_this.ipfsCoord.ipfs.orbitdb.privateLog = router
_this.ipfsCoord.adapters.orbit.privateLog = router
} catch (err) {
console.error('Error in attachRPCRouter()')
throw err
+13 -2
View File
@@ -95,8 +95,19 @@ class JSONRPC {
// Encrypt and publish the response to the originators private OrbitDB,
// if ipfs-coord has been initialized and the peers ID is registered.
if (_this.ipfsCoord.ipfs) {
await _this.ipfsCoord.ipfs.orbitdb.sendToDb(from, retStr)
// console.log('responding to JSON RPC command')
const thisNode = _this.ipfsCoord.thisNode
// console.log('thisNode: ', thisNode)
try {
await _this.ipfsCoord.useCases.peer.sendPrivateMessage(
from,
retStr,
thisNode
)
} catch (err) {
console.log('sendPrivateMessage() err: ', err)
}
// Return the response and originator. Useful for testing.
+11 -11
View File
@@ -66,16 +66,16 @@ describe('#IPFS', () => {
uut.attachRPCRouter(router)
})
it('should throw an error if ipfs-coord has not been instantiated', () => {
try {
const router = console.log
uut.attachRPCRouter(router)
assert.fail('Unexpected code path')
} catch (err) {
assert.include(err.message, 'Cannot read property')
}
})
// it('should throw an error if ipfs-coord has not been instantiated', () => {
// try {
// const router = console.log
//
// uut.attachRPCRouter(router)
//
// assert.fail('Unexpected code path')
// } catch (err) {
// assert.include(err.message, 'Cannot read property')
// }
// })
})
})