zkjson 0.1.32 → 0.1.34
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/db.js +13 -14
- package/package.json +1 -1
package/db.js
CHANGED
|
@@ -79,7 +79,7 @@ class DB {
|
|
|
79
79
|
const { proof, publicSignals } = await snarkjs.groth16.fullProve(
|
|
80
80
|
inputs,
|
|
81
81
|
this.wasm,
|
|
82
|
-
this.zkey
|
|
82
|
+
this.zkey,
|
|
83
83
|
)
|
|
84
84
|
return [
|
|
85
85
|
...proof.pi_a.slice(0, 2),
|
|
@@ -95,7 +95,7 @@ class DB {
|
|
|
95
95
|
const { proof, publicSignals } = await snarkjs.groth16.fullProve(
|
|
96
96
|
inputs,
|
|
97
97
|
this.wasmRU,
|
|
98
|
-
this.zkeyRU
|
|
98
|
+
this.zkeyRU,
|
|
99
99
|
)
|
|
100
100
|
return [
|
|
101
101
|
...proof.pi_a.slice(0, 2),
|
|
@@ -115,14 +115,14 @@ class DB {
|
|
|
115
115
|
val === null
|
|
116
116
|
? 0
|
|
117
117
|
: typeof val === "string"
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
118
|
+
? 3
|
|
119
|
+
: typeof val === "boolean"
|
|
120
|
+
? 1
|
|
121
|
+
: typeof val === "number"
|
|
122
|
+
? Number.isInteger(val)
|
|
123
|
+
? 2
|
|
124
|
+
: 2.5
|
|
125
|
+
: 4
|
|
126
126
|
switch (type) {
|
|
127
127
|
case 0:
|
|
128
128
|
return await this.zkdb.qNull(...params)
|
|
@@ -255,7 +255,7 @@ class DB {
|
|
|
255
255
|
|
|
256
256
|
async getInputs({ id, col_id, json, path, val }) {
|
|
257
257
|
const col_root = this.tree.F.toObject(this.tree.root).toString()
|
|
258
|
-
const col_res = await this.getCol(
|
|
258
|
+
const col_res = await this.getCol(col_id)
|
|
259
259
|
|
|
260
260
|
let col_siblings = col_res.siblings
|
|
261
261
|
for (let i = 0; i < col_siblings.length; i++)
|
|
@@ -335,9 +335,8 @@ class DB {
|
|
|
335
335
|
const _col = this.getColTree(col)
|
|
336
336
|
return await _col.get(_key)
|
|
337
337
|
}
|
|
338
|
-
async getCol(
|
|
339
|
-
|
|
340
|
-
return await this.tree.find(id)
|
|
338
|
+
async getCol(col) {
|
|
339
|
+
return await this.tree.find(col)
|
|
341
340
|
}
|
|
342
341
|
}
|
|
343
342
|
|