Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass empty hash correctly to iterator #1560

Merged
merged 5 commits into from
Apr 11, 2024
Merged

Conversation

Trivo25
Copy link
Member

@Trivo25 Trivo25 commented Apr 11, 2024

previously the user defined emptyHash for a MerkleList was not correctly passed down to the iterator when calling list.startIterating();, which resulsted in the iterator using the default hash of value 0

@@ -468,7 +474,8 @@ class MerkleListIterator<T> implements MerkleListIteratorBase<T> {
static createFromList<T>(merkleList: typeof MerkleList<T>) {
return this.create<T>(
merkleList.prototype.innerProvable,
merkleList._nextHash
merkleList._nextHash,
merkleList.emptyHash
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this change all that is needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yea thats right 🤕

src/lib/provable/merkle-list.ts Outdated Show resolved Hide resolved
src/lib/provable/merkle-list.ts Outdated Show resolved Hide resolved
src/lib/provable/merkle-list.ts Outdated Show resolved Hide resolved
@Trivo25 Trivo25 merged commit b6afcd7 into main Apr 11, 2024
12 checks passed
@Trivo25 Trivo25 deleted the fix-empty-hash-merklelist branch April 11, 2024 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants