mirror of
https://github.com/Qortal/pirate-librustzcash.git
synced 2025-02-23 06:05:48 +00:00
fix signature and generate h
This commit is contained in:
parent
ae364f3ae7
commit
c794cdc680
59
bindings.h
Normal file
59
bindings.h
Normal file
@ -0,0 +1,59 @@
|
||||
#include <cstdarg>
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
#include <new>
|
||||
|
||||
template<typename T>
|
||||
struct Option;
|
||||
|
||||
struct NodeLink {
|
||||
enum class Tag {
|
||||
Stored,
|
||||
Generated,
|
||||
};
|
||||
|
||||
struct Stored_Body {
|
||||
uint32_t _0;
|
||||
};
|
||||
|
||||
struct Generated_Body {
|
||||
uint32_t _0;
|
||||
};
|
||||
|
||||
Tag tag;
|
||||
union {
|
||||
Stored_Body stored;
|
||||
Generated_Body generated;
|
||||
};
|
||||
};
|
||||
|
||||
struct NodeData {
|
||||
uint8_t subtree_commitment[32];
|
||||
uint32_t start_time;
|
||||
uint32_t end_time;
|
||||
uint32_t start_target;
|
||||
uint32_t end_target;
|
||||
uint8_t start_sapling_root[32];
|
||||
uint8_t end_sapling_root[32];
|
||||
uint64_t subtree_total_work;
|
||||
uint32_t start_height;
|
||||
uint32_t end_height;
|
||||
uint64_t shielded_tx;
|
||||
};
|
||||
|
||||
struct MMRNode {
|
||||
Option<NodeLink> left;
|
||||
Option<NodeLink> right;
|
||||
NodeData data;
|
||||
};
|
||||
|
||||
extern "C" {
|
||||
|
||||
void append(const MMRNode *stored,
|
||||
uint32_t stored_count,
|
||||
const MMRNode *generated,
|
||||
uint32_t generated_count,
|
||||
uint32_t *append_count,
|
||||
MMRNode *append_buffer);
|
||||
|
||||
} // extern "C"
|
@ -58,7 +58,7 @@ pub extern fn append(
|
||||
generated_count: u32,
|
||||
append_count: *mut u32,
|
||||
append_buffer: *mut MMRNode,
|
||||
) -> MMRNode {
|
||||
) {
|
||||
|
||||
// TODO: construct tree and write to (append_count, append_buffer)
|
||||
// TODO: also return generated??
|
||||
|
Loading…
x
Reference in New Issue
Block a user