Skip to content

Commit

Permalink
update_all_ffi_interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
hansieodendaal committed Oct 20, 2021
1 parent 2d58760 commit 2673fdd
Show file tree
Hide file tree
Showing 11 changed files with 883 additions and 696 deletions.
22 changes: 10 additions & 12 deletions applications/ffi_client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ try {
let err = ref.alloc(i32);
// console.log(err);

let recoveryInProgress = ref.alloc(bool);

console.log("Create Tor transport...");
let tor = lib.transport_tor_create(
"/ip4/127.0.0.1/tcp/9051",
Expand Down Expand Up @@ -79,17 +81,13 @@ try {
const txCancelled = ffi.Callback("void", ["pointer"], function (ptr) {
console.log("txCancelled: ", ptr);
});
// callback_utxo_validation_complete: unsafe extern "C" fn(u64, u8),
const utxoValidation = ffi.Callback("void", [u64, u8], function (i, j) {
// callback_txo_validation_complete: unsafe extern "C" fn(u64, u8),
const txoValidation = ffi.Callback("void", [u64, u8], function (i, j) {
console.log("utxoValidation: ", i, j);
});
// callback_stxo_validation_complete: unsafe extern "C" fn(u64, u8),
const stxoValidation = ffi.Callback("void", [u64, u8], function (i, j) {
console.log("stxoValidation: ", i, j);
});
// callback_invalid_txo_validation_complete: unsafe extern "C" fn(u64, u8),
const itxoValidation = ffi.Callback("void", [u64, u8], function (i, j) {
console.log("itxoValidation: ", i, j);
// callback_balance_updated: unsafe extern "C" fn(*mut Balance),
const balanceUpdated = ffi.Callback("void", ["pointer"], function (ptr) {
console.log("balanceUpdated: ", ptr);
});
// callback_transaction_validation_complete: unsafe extern "C" fn(u64, u8),
const txValidation = ffi.Callback("void", [u64, u8], function (i, j) {
Expand Down Expand Up @@ -117,11 +115,11 @@ try {
directSendResult,
safResult,
txCancelled,
utxoValidation,
stxoValidation,
itxoValidation,
txoValidation,
balanceUpdated,
txValidation,
safsReceived,
recoveryInProgress,
err
);

Expand Down
2 changes: 1 addition & 1 deletion base_layer/wallet_ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ default-features = false
features = ["transactions"]

[lib]
crate-type = ["staticlib","cdylib", "lib"]
crate-type = ["staticlib","cdylib"]

[dev-dependencies]
tempfile = "3.1.0"
Expand Down
Loading

0 comments on commit 2673fdd

Please sign in to comment.