chore: expose get_leaf
This commit is contained in:
parent
d761ca9911
commit
d7831a9c95
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -94,6 +94,8 @@ bool set_metadata(struct RLN *ctx, const struct Buffer *input_buffer);
|
|||
|
||||
bool get_metadata(const struct RLN *ctx, struct Buffer *output_buffer);
|
||||
|
||||
bool flush(struct RLN *ctx);
|
||||
|
||||
bool hash(const struct Buffer *input_buffer, struct Buffer *output_buffer);
|
||||
|
||||
bool poseidon_hash(const struct Buffer *input_buffer, struct Buffer *output_buffer);
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
2
zerokit
2
zerokit
|
@ -1 +1 @@
|
|||
Subproject commit 8a365f0c9e5c4a744f70c5dd4904ce8d8f926c34
|
||||
Subproject commit 6d583200777aa94131e687e1797af0ba568a66dc
|
Loading…
Reference in New Issue