multiversx_sc_wasm_adapter/api/
log_api_node.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use super::VmApiImpl;
use multiversx_sc::api::{LogApi, LogApiImpl};

extern "C" {
    fn managedWriteLog(topicsHandle: i32, dataHandle: i32);
}

impl LogApi for VmApiImpl {
    type LogApiImpl = VmApiImpl;

    #[inline]
    fn log_api_impl() -> Self::LogApiImpl {
        VmApiImpl {}
    }
}

impl LogApiImpl for VmApiImpl {
    fn managed_write_log(
        &self,
        topics_handle: Self::ManagedBufferHandle,
        data_handle: Self::ManagedBufferHandle,
    ) {
        unsafe {
            managedWriteLog(topics_handle, data_handle);
        }
    }
}