mirror of
https://github.com/logos-messaging/go-zerokit-rln-arm.git
synced 2026-01-04 06:23:07 +00:00
Expose get_proof as GetMerkleProof (#2)
This commit is contained in:
parent
e64925564d
commit
a8b8c6ab4b
@ -245,6 +245,17 @@ func (r *RLN) GetLeaf(index uint) ([]byte, error) {
|
|||||||
return C.GoBytes(unsafe.Pointer(out.ptr), C.int(out.len)), nil
|
return C.GoBytes(unsafe.Pointer(out.ptr), C.int(out.len)), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r *RLN) GetMerkleProof(index uint) ([]byte, error) {
|
||||||
|
var output []byte
|
||||||
|
out := toBuffer(output)
|
||||||
|
|
||||||
|
if !bool(C.get_proof(r.ptr, C.uintptr_t(index), &out)) {
|
||||||
|
return nil, errors.New("could not get the proof")
|
||||||
|
}
|
||||||
|
|
||||||
|
return C.GoBytes(unsafe.Pointer(out.ptr), C.int(out.len)), nil
|
||||||
|
}
|
||||||
|
|
||||||
func (r *RLN) LeavesSet() uint {
|
func (r *RLN) LeavesSet() uint {
|
||||||
return uint(C.leaves_set(r.ptr))
|
return uint(C.leaves_set(r.ptr))
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user