mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-08 17:03:09 +00:00
chore: add merkleroot macro for testing purpose inside generateProof
This commit is contained in:
parent
19b95930c3
commit
961ec74c95
@ -98,7 +98,7 @@ proc fetchMerkleProofElements*(
|
||||
let merkleProof = await merkleProofInvocation.call()
|
||||
return ok(merkleProof)
|
||||
except CatchableError:
|
||||
error "Failed to fetch merkle proof", errMsg = getCurrentExceptionMsg()
|
||||
error "Failed to fetch merkle proof - 1", errMsg = getCurrentExceptionMsg()
|
||||
|
||||
proc fetchMerkleRoot*(
|
||||
g: OnchainGroupManager
|
||||
@ -313,15 +313,23 @@ method generateProof*(
|
||||
|
||||
let externalNullifierRes = poseidon(@[@(epoch), @(rlnIdentifier)])
|
||||
|
||||
try:
|
||||
let rootRes = waitFor g.fetchMerkleRoot()
|
||||
if rootRes.isErr():
|
||||
return err("Failed to fetch Merkle root")
|
||||
debug "Merkle root fetched", root = rootRes.get().toHex
|
||||
except CatchableError:
|
||||
error "Failed to fetch Merkle root", error = getCurrentExceptionMsg()
|
||||
|
||||
try:
|
||||
let proofResult = waitFor g.fetchMerkleProofElements()
|
||||
if proofResult.isErr():
|
||||
return err("Failed to fetch Merkle proof: " & $proofResult.error)
|
||||
return err("Failed to fetch Merkle proof - 2: " & $proofResult.error)
|
||||
g.merkleProofCache = proofResult.get()
|
||||
debug "Merkle proof fetched",
|
||||
membershipIndex = g.membershipIndex.get(), elementCount = g.merkleProofCache.len
|
||||
except CatchableError:
|
||||
error "Failed to fetch merkle proof", error = getCurrentExceptionMsg()
|
||||
error "Failed to fetch merkle proof - 3", error = getCurrentExceptionMsg()
|
||||
|
||||
let witness = Witness(
|
||||
identity_secret: g.idCredentials.get().idSecretHash.toArray32(),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user