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

Introduce SimpleSmt::with_contiguous_leaves() #227

Merged
merged 2 commits into from
Nov 27, 2023

Conversation

plafer
Copy link
Contributor

@plafer plafer commented Nov 27, 2023

Introduces SimpleSmt::with_contiguous_leaves() which is useful to build a SimpleSmt from complex iterator expressions, and where we want to pack all the leaves from index 0 and on.

For example, this is now possible (a pattern needed in miden-node to build the created notes tree):

// simplified
SimpleSmt::with_contiguous_leaves(
    DEPTH,
    note_envelopes
        .flat_map(|note| [note.note_hash(), note.metadata()])
        .collect::<Vec<_>>(),
)
.unwrap();

Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Contributor

@hackaugusto hackaugusto left a comment

Choose a reason for hiding this comment

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

lgtm

@plafer plafer merged commit 5f48be8 into next Nov 27, 2023
11 checks passed
@plafer plafer deleted the plafer-simplesmt-withleaves branch November 27, 2023 19:19
bobbinth pushed a commit that referenced this pull request Dec 21, 2023
bobbinth pushed a commit that referenced this pull request Feb 14, 2024
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