You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: bindings/src/ffi_test_utils.rs
+24-1Lines changed: 24 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -6,10 +6,11 @@ use hex;
6
6
usecrate::adaptors::primitives::FFIEvents;
7
7
usecrate::utils::into_fixed_buffer;
8
8
usecrate::Out;
9
-
use lightning::ln::channelmanager::{PaymentHash,PaymentSecret,PaymentPreimage};
9
+
use lightning::ln::channelmanager::{PaymentHash,PaymentSecret,PaymentPreimage,ChannelDetails};
10
10
use bitcoin_hashes::core::time::Duration;
11
11
use lightning::chain::keysinterface::SpendableOutputDescriptor;
12
12
use bitcoin::TxOut;
13
+
use lightning::ln::features::InitFeatures;
13
14
14
15
15
16
// These tests should be used for asserting that the wrapper can receive expected items from rust.
@@ -71,5 +72,27 @@ ffi! {
71
72
let buf = unsafe_block!("The buffer lives as long as this function, the length is within the buffer and the buffer won't be read before initialization" => buf_out.as_uninit_bytes_mut(buf_len));
let id_ref= &hex::decode("4141414141414141414141414141414141414141414141414141414141414142").unwrap();
78
+
letmut id = [0u8;32];
79
+
id.copy_from_slice(id_ref);
80
+
let remote_network_id = bitcoin::secp256k1::key::PublicKey::from_slice(&hex::decode("02aca35d6de21baefaf65db590611fabd42ed4d52683c36caff58761d309314f65").unwrap()).unwrap();
81
+
let counterparty_features = InitFeatures::known();
82
+
let detail = ChannelDetails{
83
+
channel_id: id,
84
+
short_channel_id:Some(3),
85
+
remote_network_id,
86
+
counterparty_features: counterparty_features,
87
+
channel_value_satoshis:5454,
88
+
user_id:2223,
89
+
outbound_capacity_msat:2828,
90
+
inbound_capacity_msat:9292,
91
+
is_live:false
92
+
};
93
+
ret.push(detail);
94
+
let buf = unsafe_block!("The buffer lives as long as this function, the length is within the buffer and the buffer won't be read before initialization" => buf_out.as_uninit_bytes_mut(buf_len));
0 commit comments