change MerkleProof interface to take array of bytes32 (#879)
This commit is contained in:
committed by
GitHub
parent
915f74c5f6
commit
06666be93a
@ -79,7 +79,7 @@ export default class MerkleTree {
|
||||
getHexProof (el) {
|
||||
const proof = this.getProof(el);
|
||||
|
||||
return this.bufArrToHex(proof);
|
||||
return this.bufArrToHexArr(proof);
|
||||
}
|
||||
|
||||
getPairElement (idx, layer) {
|
||||
@ -117,12 +117,12 @@ export default class MerkleTree {
|
||||
});
|
||||
}
|
||||
|
||||
bufArrToHex (arr) {
|
||||
bufArrToHexArr (arr) {
|
||||
if (arr.some(el => !Buffer.isBuffer(el))) {
|
||||
throw new Error('Array is not an array of buffers');
|
||||
}
|
||||
|
||||
return '0x' + arr.map(el => el.toString('hex')).join('');
|
||||
return arr.map(el => '0x' + el.toString('hex'));
|
||||
}
|
||||
|
||||
sortAndConcat (...args) {
|
||||
|
||||
Reference in New Issue
Block a user