mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-04 23:13:09 +00:00
chore: simplify process
This commit is contained in:
parent
a15f3fc782
commit
9ed5e2cbf5
@ -106,6 +106,11 @@ proc seqToField*(s: seq[byte]): array[32, byte] =
|
||||
for i in 0 ..< len:
|
||||
result[i] = s[i]
|
||||
|
||||
proc uint64ToIndex*(value: uint64, numBits: int = 64): seq[uint8] =
|
||||
result = newSeq[uint8](numBits)
|
||||
for i in 0..<numBits:
|
||||
result[i] = uint8((value shr i) and 1)
|
||||
|
||||
proc fetchMerkleProofElements*(
|
||||
g: OnchainGroupManager
|
||||
): Future[Result[seq[byte], string]] {.async.} =
|
||||
@ -380,7 +385,7 @@ method generateProof*(
|
||||
|
||||
let index_len = int(g.merkleProofCache.len / 32)
|
||||
let identity_path_index =
|
||||
uint64ToField(uint64(g.membershipIndex.get()))[0 .. index_len - 1]
|
||||
uint64ToIndex(uint64(g.membershipIndex.get()), index_len)
|
||||
|
||||
debug "--- identityPathIndex ---",
|
||||
before = g.membershipIndex.get(),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user