diff --git a/package.json b/package.json index bc6065a..f060fb8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fixed-merkle-tree", - "version": "0.4.0", + "version": "0.5.0", "description": "Fixed depth merkle tree implementation with sequential inserts", "main": "src/merkleTree.js", "scripts": { diff --git a/src/merkleTree.js b/src/merkleTree.js index 4fc6b92..72612ea 100644 --- a/src/merkleTree.js +++ b/src/merkleTree.js @@ -161,8 +161,6 @@ class MerkleTree { serialize() { return { levels: this.levels, - capacity: this.capacity, - zeroElement: this.zeroElement, _zeros: this._zeros, _layers: this._layers, } @@ -180,6 +178,8 @@ class MerkleTree { static deserialize(data, hashFunction) { const instance = Object.assign(Object.create(this.prototype), data) instance._hash = hashFunction || defaultHash + instance.capacity = 1 << instance.levels + instance.zeroElement = instance._zeros[0] return instance } }