From 2744d4601f6e3db461515d894314d25364faa59b Mon Sep 17 00:00:00 2001 From: Andrei Gubarev <1062334+agubarev@users.noreply.github.com> Date: Mon, 11 Jul 2022 15:51:00 +0300 Subject: [PATCH] fix: cbindgen fix (#4298) Description --- cbindgen was ignoring TariUtxo Motivation and Context --- To expose `TariUtxo` in the FFI header file How Has This Been Tested? --- manually --- base_layer/wallet_ffi/build.rs | 6 +++++- base_layer/wallet_ffi/wallet.h | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/base_layer/wallet_ffi/build.rs b/base_layer/wallet_ffi/build.rs index af2a1ae4ed..29e32918c4 100644 --- a/base_layer/wallet_ffi/build.rs +++ b/base_layer/wallet_ffi/build.rs @@ -3,7 +3,7 @@ use std::{env, path::PathBuf}; -use cbindgen::{Config, Language, ParseConfig, Style}; +use cbindgen::{Config, ExportConfig, Language, ParseConfig, Style}; fn main() { let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap(); @@ -28,6 +28,10 @@ fn main() { autogen_warning: Some("// This file was generated by cargo-bindgen. Please do not edit manually.".to_string()), style: Style::Tag, cpp_compat: true, + export: ExportConfig { + include: vec!["TariUtxo".to_string()], + ..Default::default() + }, ..Default::default() }; diff --git a/base_layer/wallet_ffi/wallet.h b/base_layer/wallet_ffi/wallet.h index db6be26839..8eb936227e 100644 --- a/base_layer/wallet_ffi/wallet.h +++ b/base_layer/wallet_ffi/wallet.h @@ -305,6 +305,14 @@ typedef struct FeePerGramStatsResponse TariFeePerGramStats; typedef struct FeePerGramStat TariFeePerGramStat; +struct TariUtxo { + const char *commitment; + uint64_t value; + uint64_t mined_height; + uint64_t mined_timestamp; + uint8_t status; +}; + #ifdef __cplusplus extern "C" { #endif // __cplusplus