diff --git a/src/identity/processor.rs b/src/identity/processor.rs index a2f246bf..82ba2b36 100644 --- a/src/identity/processor.rs +++ b/src/identity/processor.rs @@ -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."); e })?; diff --git a/src/identity_tree/mod.rs b/src/identity_tree/mod.rs index 7a4b193c..221a55d7 100644 --- a/src/identity_tree/mod.rs +++ b/src/identity_tree/mod.rs @@ -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),