mirror of
https://github.com/logos-messaging/go-zerokit-rln-apple.git
synced 2026-01-02 05:13:11 +00:00
chore: expose get_leaf
This commit is contained in:
parent
13b66414cd
commit
6df4912fe3
@ -222,3 +222,14 @@ func (r *RLN) GetRoot() ([]byte, error) {
|
||||
|
||||
return C.GoBytes(unsafe.Pointer(out.ptr), C.int(out.len)), nil
|
||||
}
|
||||
|
||||
func (r *RLN) GetLeaf(index uint) ([]byte, error) {
|
||||
var output []byte
|
||||
out := toBuffer(output)
|
||||
|
||||
if !bool(C.get_leaf(r.ptr, C.uintptr_t(index), &out)) {
|
||||
return nil, errors.New("could not get the leaf")
|
||||
}
|
||||
|
||||
return C.GoBytes(unsafe.Pointer(out.ptr), C.int(out.len)), nil
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user