@cryptoeconomicslab/merkle-tree
Advanced tools
Comparing version 0.4.1 to 0.5.0
@@ -42,2 +42,3 @@ import { Bytes, Address, BigNumber, Range, Struct, FixedBytes } from '@cryptoeconomicslab/primitives'; | ||
getRoot(): FixedBytes; | ||
findIndexByInterval(interval: BigNumber): number | null; | ||
findIndex(leaf: FixedBytes): number | null; | ||
@@ -44,0 +45,0 @@ getLeaf(index: number): DoubleLayerTreeLeaf; |
@@ -137,2 +137,6 @@ "use strict"; | ||
} | ||
findIndexByInterval(interval) { | ||
const foundIndex = this.leaves.findIndex(l => l.start.equals(interval)); | ||
return foundIndex >= 0 ? foundIndex : null; | ||
} | ||
findIndex(leaf) { | ||
@@ -139,0 +143,0 @@ const foundIndex = this.leaves.findIndex(l => l.getData().toHexString() == leaf.toHexString()); |
{ | ||
"name": "@cryptoeconomicslab/merkle-tree", | ||
"version": "0.4.1", | ||
"version": "0.5.0", | ||
"description": "merkle tree implementation", | ||
@@ -32,11 +32,11 @@ "author": { | ||
"dependencies": { | ||
"@cryptoeconomicslab/hash": "^0.4.1", | ||
"@cryptoeconomicslab/utils": "^0.4.1", | ||
"@cryptoeconomicslab/hash": "^0.5.0", | ||
"@cryptoeconomicslab/utils": "^0.5.0", | ||
"jsbi": "^3.1.2" | ||
}, | ||
"devDependencies": { | ||
"@cryptoeconomicslab/coder": "^0.4.1", | ||
"@cryptoeconomicslab/context": "^0.4.1", | ||
"@cryptoeconomicslab/eth-coder": "^0.4.1", | ||
"@cryptoeconomicslab/primitives": "^0.4.1" | ||
"@cryptoeconomicslab/coder": "^0.5.0", | ||
"@cryptoeconomicslab/context": "^0.5.0", | ||
"@cryptoeconomicslab/eth-coder": "^0.5.0", | ||
"@cryptoeconomicslab/primitives": "^0.5.0" | ||
}, | ||
@@ -46,3 +46,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "eaf8a8a1daf01d022b1ac36461f8ffd72d737f83" | ||
"gitHead": "83bf87b438d3bc2161d92af731c0cc54da78c77f" | ||
} |
Sorry, the diff of this file is not supported yet
61074
715
+ Added@cryptoeconomicslab/hash@0.5.0(transitive)
+ Added@cryptoeconomicslab/utils@0.5.0(transitive)
- Removed@cryptoeconomicslab/hash@0.4.1(transitive)
- Removed@cryptoeconomicslab/utils@0.4.1(transitive)