mirror of
https://github.com/logos-messaging/logos-messaging-rust-bindings.git
synced 2026-05-21 18:09:51 +00:00
Fix management inner calls
This commit is contained in:
parent
dc292e44f5
commit
0ea46ed464
@ -61,7 +61,7 @@ pub fn waku_start() -> Result<bool> {
|
|||||||
/// Stops a Waku node
|
/// Stops a Waku node
|
||||||
/// as per the [specification](https://rfc.vac.dev/spec/36/#extern-char-waku_stop)
|
/// as per the [specification](https://rfc.vac.dev/spec/36/#extern-char-waku_stop)
|
||||||
pub fn waku_stop() -> Result<bool> {
|
pub fn waku_stop() -> Result<bool> {
|
||||||
let response_ptr = unsafe { waku_sys::waku_start() };
|
let response_ptr = unsafe { waku_sys::waku_stop() };
|
||||||
let response = unsafe { CStr::from_ptr(response_ptr) }
|
let response = unsafe { CStr::from_ptr(response_ptr) }
|
||||||
.to_str()
|
.to_str()
|
||||||
.expect("Response should always succeed to load to a &str");
|
.expect("Response should always succeed to load to a &str");
|
||||||
@ -79,7 +79,7 @@ pub fn waku_stop() -> Result<bool> {
|
|||||||
/// If the execution is successful, the result is the peer ID as a string (base58 encoded)
|
/// If the execution is successful, the result is the peer ID as a string (base58 encoded)
|
||||||
/// as per the [specification](https://rfc.vac.dev/spec/36/#extern-char-waku_stop)
|
/// as per the [specification](https://rfc.vac.dev/spec/36/#extern-char-waku_stop)
|
||||||
pub fn waku_peer_id() -> Result<PeerId> {
|
pub fn waku_peer_id() -> Result<PeerId> {
|
||||||
let response_ptr = unsafe { waku_sys::waku_start() };
|
let response_ptr = unsafe { waku_sys::waku_peerid() };
|
||||||
let response = unsafe { CStr::from_ptr(response_ptr) }
|
let response = unsafe { CStr::from_ptr(response_ptr) }
|
||||||
.to_str()
|
.to_str()
|
||||||
.expect("Response should always succeed to load to a &str");
|
.expect("Response should always succeed to load to a &str");
|
||||||
@ -97,7 +97,7 @@ pub fn waku_peer_id() -> Result<PeerId> {
|
|||||||
/// Get the multiaddresses the Waku node is listening to
|
/// Get the multiaddresses the Waku node is listening to
|
||||||
/// as per [specification](https://rfc.vac.dev/spec/36/#extern-char-waku_listen_addresses)
|
/// as per [specification](https://rfc.vac.dev/spec/36/#extern-char-waku_listen_addresses)
|
||||||
pub fn waku_listen_addresses() -> Result<Vec<Multiaddr>> {
|
pub fn waku_listen_addresses() -> Result<Vec<Multiaddr>> {
|
||||||
let response_ptr = unsafe { waku_sys::waku_start() };
|
let response_ptr = unsafe { waku_sys::waku_listen_addresses() };
|
||||||
let response = unsafe { CStr::from_ptr(response_ptr) }
|
let response = unsafe { CStr::from_ptr(response_ptr) }
|
||||||
.to_str()
|
.to_str()
|
||||||
.expect("Response should always succeed to load to a &str");
|
.expect("Response should always succeed to load to a &str");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user