zkjson 0.1.32 → 0.1.34

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/db.js +13 -14
  2. 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
- ? 3
119
- : typeof val === "boolean"
120
- ? 1
121
- : typeof val === "number"
122
- ? Number.isInteger(val)
123
- ? 2
124
- : 2.5
125
- : 4
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(id)
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(_key) {
339
- const id = toIndex(_key)
340
- return await this.tree.find(id)
338
+ async getCol(col) {
339
+ return await this.tree.find(col)
341
340
  }
342
341
  }
343
342
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zkjson",
3
- "version": "0.1.32",
3
+ "version": "0.1.34",
4
4
  "description": "Zero Knowledge Provable JSON",
5
5
  "main": "index.js",
6
6
  "license": "MIT",