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

Update get_proof_for()to fetch TreeVersion by item status #807

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/identity/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ impl OnChainIdentityProcessor {
)
.await
.map_err(|e| {
error!(?e, "Failed to insert identity to contract.");
error!(?e, "Failed to insert identity to contract.");
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
error!(?e, "Failed to insert identity to contract.");
error!(?e, "Failed to insert identity to contract.");

e
})?;

Expand Down
7 changes: 6 additions & 1 deletion src/identity_tree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,12 @@ impl TreeState {

#[must_use]
pub fn get_proof_for(&self, item: &TreeItem) -> (Field, InclusionProof) {
let (leaf, root, proof) = self.latest.get_leaf_and_proof(item.leaf_index);
let (leaf, root, proof) = match item.status {
ProcessedStatus::Processed | ProcessedStatus::Mined => {
self.processed.get_leaf_and_proof(item.leaf_index)
}
ProcessedStatus::Pending => self.latest.get_leaf_and_proof(item.leaf_index),
};

let proof = InclusionProof {
root: Some(root),
Expand Down
Loading