Skip to content

Commit

Permalink
clone array
Browse files Browse the repository at this point in the history
  • Loading branch information
Trivo25 committed Apr 14, 2024
1 parent 2563be9 commit 1a7f596
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/provable/merkle-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ class MerkleList<T> implements MerkleListBase<T> {
* Creates a `MerkleList` from an array but reverses it.
*/
static fromReverse(array: T[]): MerkleList<T> {
array = array.reverse();
array = [...array].reverse();
let { hash, data } = withHashes(array, nextHash, emptyHash_);
let unconstrained = Unconstrained.witness(() =>
data.map((x) => toConstant(type, x))
Expand Down Expand Up @@ -552,6 +552,7 @@ class MerkleListIterator<T> implements MerkleListIteratorBase<T> {
element
);
};

return iter;
}

Expand Down

0 comments on commit 1a7f596

Please sign in to comment.