zkjson 0.3.1 → 0.3.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.
- package/collection.js +2 -2
- package/db.js +4 -3
- package/doc.js +2 -2
- package/package.json +1 -1
package/collection.js
CHANGED
@@ -14,8 +14,8 @@ class Collection {
|
|
14
14
|
size_json: this.size_json,
|
15
15
|
})
|
16
16
|
}
|
17
|
-
async getInputs({ id, json, path, val }) {
|
18
|
-
const doc_inputs = await this.doc.getInputs({ json, path, val })
|
17
|
+
async getInputs({ id, json, path, val, query }) {
|
18
|
+
const doc_inputs = await this.doc.getInputs({ json, path, val, query })
|
19
19
|
const res = await this.get(id)
|
20
20
|
let siblings = res.siblings
|
21
21
|
for (let i = 0; i < siblings.length; i++)
|
package/db.js
CHANGED
@@ -69,13 +69,14 @@ class DB {
|
|
69
69
|
return this._getVal(j, p.split("."))
|
70
70
|
}
|
71
71
|
|
72
|
-
async genProof({ json, col_id, path, id }) {
|
72
|
+
async genProof({ json, col_id, path, id, query }) {
|
73
73
|
const inputs = await this.getInputs({
|
74
74
|
id,
|
75
75
|
col_id,
|
76
76
|
json,
|
77
77
|
path,
|
78
78
|
val: this.getVal(json, path),
|
79
|
+
query,
|
79
80
|
})
|
80
81
|
const { proof, publicSignals } = await snarkjs.groth16.fullProve(
|
81
82
|
inputs,
|
@@ -254,7 +255,7 @@ class DB {
|
|
254
255
|
}
|
255
256
|
}
|
256
257
|
|
257
|
-
async getInputs({ id, col_id, json, path, val }) {
|
258
|
+
async getInputs({ id, col_id, json, path, val, query }) {
|
258
259
|
const col_root = this.tree.F.toObject(this.tree.root).toString()
|
259
260
|
const col_res = await this.getCol(col_id)
|
260
261
|
|
@@ -265,7 +266,7 @@ class DB {
|
|
265
266
|
col_siblings = col_siblings.map(s => s.toString())
|
266
267
|
const col_key = col_id
|
267
268
|
const col = this.getColTree(col_id)
|
268
|
-
const col_inputs = await col.getInputs({ id, json, path, val })
|
269
|
+
const col_inputs = await col.getInputs({ id, json, path, val, query })
|
269
270
|
return {
|
270
271
|
path: col_inputs.path,
|
271
272
|
val: col_inputs.val,
|
package/doc.js
CHANGED
@@ -46,8 +46,8 @@ module.exports = class Doc {
|
|
46
46
|
if (p === "") return j
|
47
47
|
return this._getVal(j, p.split("."))
|
48
48
|
}
|
49
|
-
async genProof(json, path) {
|
50
|
-
const inputs = await this.getInputs(json, path)
|
49
|
+
async genProof({ json, path, query }) {
|
50
|
+
const inputs = await this.getInputs({ json, path, query })
|
51
51
|
const { proof, publicSignals } = await snarkjs.groth16.fullProve(
|
52
52
|
inputs,
|
53
53
|
this.wasm,
|