Skip to content

Commit

Permalink
fix: cbindgen fix (#4298)
Browse files Browse the repository at this point in the history
Description
---
cbindgen was ignoring TariUtxo

Motivation and Context
---
To expose `TariUtxo` in the FFI header file

How Has This Been Tested?
---
manually
  • Loading branch information
agubarev authored Jul 11, 2022
1 parent 6d23ff8 commit 2744d46
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 5 additions & 1 deletion base_layer/wallet_ffi/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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()
};

Expand Down
8 changes: 8 additions & 0 deletions base_layer/wallet_ffi/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2744d46

Please sign in to comment.