Browse Source

fix to use hypercore keypair temporarily in tests

Kieran Gibb 2 years ago
parent
commit
90a8809c93
No known key found for this signature in database
3 changed files with 11 additions and 11 deletions
  1. 1
    0
      package.json
  2. 7
    6
      test/index.test.js
  3. 3
    5
      yarn.lock

+ 1
- 0
package.json View File

@@ -16,6 +16,7 @@
16 16
     "urlsafe-base64": "^1.0.0"
17 17
   },
18 18
   "devDependencies": {
19
+    "hypercore-crypto": "^1.0.0",
19 20
     "nyc": "^14.1.1",
20 21
     "rimraf": "^2.6.3",
21 22
     "tap-spec": "^5.0.0",

+ 7
- 6
test/index.test.js View File

@@ -1,6 +1,7 @@
1 1
 const { describe } = require('tape-plus')
2 2
 const Config = require('../')
3 3
 const crypto = require('cobox-crypto')()
4
+const { keyPair } = require('hypercore-crypto')
4 5
 const fs = require('fs')
5 6
 const path = require('path')
6 7
 const yaml = require('js-yaml')
@@ -68,7 +69,7 @@ describe('set', (context) => {
68 69
   context('byKey', (assert, next) => {
69 70
     var config = Config(storage)
70 71
     var group = crypto.unpack(crypto.accessKey())
71
-    var identity = crypto.keyPair()
72
+    var identity = keyPair()
72 73
 
73 74
     config.groups.set(group.publicKey, group)
74 75
     config.identities.set(identity.publicKey, identity)
@@ -87,7 +88,7 @@ describe('set', (context) => {
87 88
   context('byName', (assert, next) => {
88 89
     var config = Config(storage)
89 90
     var group = Object.assign({ name: 'group-a' }, crypto.unpack(crypto.accessKey()))
90
-    var identity = Object.assign({ name: 'Alice' }, crypto.keyPair())
91
+    var identity = Object.assign({ name: 'Alice' }, keyPair())
91 92
 
92 93
     config.groups.set(group.publicKey, group)
93 94
     config.identities.set(identity.publicKey, identity)
@@ -125,7 +126,7 @@ describe('get', (context) => {
125 126
   context('works with buffers or strings', (assert, next) => {
126 127
     var config = Config(storage)
127 128
     var group = crypto.unpack(crypto.accessKey())
128
-    var identity = crypto.keyPair()
129
+    var identity = keyPair()
129 130
 
130 131
     config.groups.set(group.publicKey, group)
131 132
     config.identities.set(identity.publicKey, identity)
@@ -155,7 +156,7 @@ describe('del', (context) => {
155 156
   context('deletes relevant entry using buffers', (assert, next) => {
156 157
     var config = Config(storage)
157 158
     var group = crypto.unpack(crypto.accessKey())
158
-    var identity = crypto.keyPair()
159
+    var identity = keyPair()
159 160
 
160 161
     config.groups.set(group.publicKey, group)
161 162
     config.identities.set(identity.publicKey, identity)
@@ -174,7 +175,7 @@ describe('del', (context) => {
174 175
   context('deletes relevant entry using buffers', (assert, next) => {
175 176
     var config = Config(storage)
176 177
     var group = crypto.unpack(crypto.accessKey())
177
-    var identity = crypto.keyPair()
178
+    var identity = keyPair()
178 179
 
179 180
     config.groups.set(group.publicKey, group)
180 181
     config.identities.set(identity.publicKey, identity)
@@ -193,7 +194,7 @@ describe('del', (context) => {
193 194
   context('deletes relevant entry using names', (assert, next) => {
194 195
     var config = Config(storage)
195 196
     var group = Object.assign({ name: 'group-a' }, crypto.unpack(crypto.accessKey()))
196
-    var identity = Object.assign({ name: 'Alice' }, crypto.keyPair())
197
+    var identity = Object.assign({ name: 'Alice' }, keyPair())
197 198
 
198 199
     config.groups.set(group.publicKey, group)
199 200
     config.identities.set(identity.publicKey, identity)

+ 3
- 5
yarn.lock View File

@@ -241,13 +241,11 @@ cliui@^5.0.0:
241 241
     strip-ansi "^5.2.0"
242 242
     wrap-ansi "^5.1.0"
243 243
 
244
-cobox-crypto@^1.0.2:
245
-  version "1.0.2"
246
-  resolved "https://registry.yarnpkg.com/cobox-crypto/-/cobox-crypto-1.0.2.tgz#7d4ccd6bd7167954217b414932a93c9debd4401e"
247
-  integrity sha512-Y9VnBV4o/8GgcZYmqQTnKYVZ5VLI7xqtsTrNqxIXcYDAS+HDr7yhBQkGN5/xK4216/VxffU4sClqyz12EZpleQ==
244
+"cobox-crypto@git+ssh://git@ledger-git.dyne.org:2240/CoBox/cobox-crypto.git":
245
+  version "1.1.0"
246
+  resolved "git+ssh://git@ledger-git.dyne.org:2240/CoBox/cobox-crypto.git#5a64d8b1ee3746f729cd0c69165d4417988903ab"
248 247
   dependencies:
249 248
     assert "^2.0.0"
250
-    debug "^4.1.1"
251 249
     hypercore-crypto "^1.0.0"
252 250
     sodium-native "^2.4.2"
253 251