fix: call waku_setup when instantiating waku_new
This commit is contained in:
parent
0cf27d112c
commit
44ad6804ae
|
@ -15,8 +15,12 @@ use crate::utils::{get_trampoline, handle_json_response, handle_no_response, han
|
|||
/// Instantiates a Waku node
|
||||
/// as per the [specification](https://rfc.vac.dev/spec/36/#extern-char-waku_newchar-jsonconfig)
|
||||
pub fn waku_new(config: Option<WakuNodeConfig>) -> Result<WakuNodeContext> {
|
||||
let config = config.unwrap_or_default();
|
||||
unsafe {
|
||||
waku_sys::waku_setup();
|
||||
}
|
||||
|
||||
|
||||
let config = config.unwrap_or_default();
|
||||
let config_ptr = CString::new(
|
||||
serde_json::to_string(&config)
|
||||
.expect("Serialization from properly built NodeConfig should never fail"),
|
||||
|
|
Loading…
Reference in New Issue