mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-03-26 12:13:08 +00:00
Missing fmt
This commit is contained in:
parent
17b36b924e
commit
ec6caee2dc
@ -1,8 +1,8 @@
|
|||||||
fn main() {
|
fn main() {
|
||||||
let crate_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();
|
let crate_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();
|
||||||
|
|
||||||
let config = cbindgen::Config::from_file("cbindgen.toml")
|
let config =
|
||||||
.expect("Unable to read cbindgen.toml");
|
cbindgen::Config::from_file("cbindgen.toml").expect("Unable to read cbindgen.toml");
|
||||||
|
|
||||||
cbindgen::Builder::new()
|
cbindgen::Builder::new()
|
||||||
.with_crate(crate_dir)
|
.with_crate(crate_dir)
|
||||||
|
|||||||
@ -147,9 +147,7 @@ pub extern "C" fn wallet_ffi_free_private_account_keys(keys: *mut FfiPrivateAcco
|
|||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
let keys = &*keys;
|
let keys = &*keys;
|
||||||
if !keys.incoming_viewing_public_key.is_null()
|
if !keys.incoming_viewing_public_key.is_null() && keys.incoming_viewing_public_key_len > 0 {
|
||||||
&& keys.incoming_viewing_public_key_len > 0
|
|
||||||
{
|
|
||||||
let slice = std::slice::from_raw_parts_mut(
|
let slice = std::slice::from_raw_parts_mut(
|
||||||
keys.incoming_viewing_public_key as *mut u8,
|
keys.incoming_viewing_public_key as *mut u8,
|
||||||
keys.incoming_viewing_public_key_len,
|
keys.incoming_viewing_public_key_len,
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
//! Token transfer functions.
|
//! Token transfer functions.
|
||||||
|
|
||||||
use std::ffi::{CString, c_ulonglong};
|
use std::ffi::{c_ulonglong, CString};
|
||||||
use std::ptr;
|
use std::ptr;
|
||||||
|
|
||||||
use common::error::ExecutionFailureKind;
|
use common::error::ExecutionFailureKind;
|
||||||
|
|||||||
@ -17,7 +17,9 @@ pub(crate) struct WalletWrapper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Helper to get the wallet wrapper from an opaque handle.
|
/// Helper to get the wallet wrapper from an opaque handle.
|
||||||
pub(crate) fn get_wallet(handle: *mut WalletHandle) -> Result<&'static WalletWrapper, WalletFfiError> {
|
pub(crate) fn get_wallet(
|
||||||
|
handle: *mut WalletHandle,
|
||||||
|
) -> Result<&'static WalletWrapper, WalletFfiError> {
|
||||||
if handle.is_null() {
|
if handle.is_null() {
|
||||||
set_last_error("Null wallet handle");
|
set_last_error("Null wallet handle");
|
||||||
return Err(WalletFfiError::NullPointer);
|
return Err(WalletFfiError::NullPointer);
|
||||||
@ -27,7 +29,9 @@ pub(crate) fn get_wallet(handle: *mut WalletHandle) -> Result<&'static WalletWra
|
|||||||
|
|
||||||
/// Helper to get a mutable reference to the wallet wrapper.
|
/// Helper to get a mutable reference to the wallet wrapper.
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub(crate) fn get_wallet_mut(handle: *mut WalletHandle) -> Result<&'static mut WalletWrapper, WalletFfiError> {
|
pub(crate) fn get_wallet_mut(
|
||||||
|
handle: *mut WalletHandle,
|
||||||
|
) -> Result<&'static mut WalletWrapper, WalletFfiError> {
|
||||||
if handle.is_null() {
|
if handle.is_null() {
|
||||||
set_last_error("Null wallet handle");
|
set_last_error("Null wallet handle");
|
||||||
return Err(WalletFfiError::NullPointer);
|
return Err(WalletFfiError::NullPointer);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user