hypercore-signing-request 3.1.0 → 3.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +2 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -50,7 +50,6 @@ module.exports = {
50
50
  if (!core.opened) await core.ready()
51
51
 
52
52
  if (core.core.compat && !manifest) throw new Error('Cannot generate signing requests for compat cores')
53
- if (core.fork !== fork) throw new Error('Core should have the same fork')
54
53
  if (!manifest) manifest = core.manifest
55
54
 
56
55
  return c.encode(Request, {
@@ -71,9 +70,10 @@ module.exports = {
71
70
  return req
72
71
  },
73
72
  signable (pub, req) {
73
+ const v = req.manifest.version
74
74
  for (const s of req.manifest.signers) {
75
75
  if (s.publicKey.equals(pub)) {
76
- return caps.treeSignable(s.namespace, req.treeHash, req.length, req.fork)
76
+ return caps.treeSignable(v === 0 ? s.namespace : req.key, req.treeHash, req.length, req.fork)
77
77
  }
78
78
  }
79
79
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hypercore-signing-request",
3
- "version": "3.1.0",
3
+ "version": "3.1.2",
4
4
  "description": "Generate shareable signing requests for Hypercore",
5
5
  "main": "index.js",
6
6
  "scripts": {