rust: Move `incremental_sinsemilla_tree_ffi` into crate root

Having this be a submodule of `orchard_ffi` while following Rust 2018
module structure made it impossible to use the `include!` macro on
`orchard_ffi.rs`, which is exactly what the `zcash_script` crate does.
See this comment for details:
    https://github.com/rust-lang/rust/issues/50132#issuecomment-969450868

To resolve this, we restructure the FFI library crate to only have FFI
methods in "leaf" module files.
This commit is contained in:
Jack Grigg 2021-11-16 18:29:50 +00:00
parent bdbd86edb7
commit 675e489aff
3 changed files with 3 additions and 4 deletions

View File

@ -6,13 +6,13 @@ use std::mem::size_of_val;
use std::ptr;
use orchard::{bundle::Authorized, tree::MerkleHashOrchard};
use tracing::error;
use zcash_primitives::{
merkle_tree::incremental::{read_frontier_v1, read_tree, write_frontier_v1, write_tree},
transaction::components::Amount,
};
use crate::orchard_ffi::{error, CppStreamReader, CppStreamWriter, ReadCb, StreamObj, WriteCb};
use crate::streams_ffi::{CppStreamReader, CppStreamWriter, ReadCb, StreamObj, WriteCb};
pub const MERKLE_DEPTH: u8 = 32;
pub const MAX_CHECKPOINTS: usize = 100;

View File

@ -19,8 +19,6 @@ use zcash_primitives::transaction::{
use crate::streams_ffi::{CppStreamReader, CppStreamWriter, ReadCb, StreamObj, WriteCb};
mod incremental_sinsemilla_tree_ffi;
#[no_mangle]
pub extern "C" fn orchard_bundle_clone(
bundle: *const Bundle<Authorized, Amount>,

View File

@ -70,6 +70,7 @@ mod tracing_ffi;
mod address_ffi;
mod history_ffi;
mod incremental_sinsemilla_tree_ffi;
mod orchard_ffi;
mod transaction_ffi;
mod zip339_ffi;