multiversx_chain_vm/vm_hooks/vh_handler/
vh_log.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::{tx_mock::TxLog, types::RawHandle, vm_hooks::VMHooksHandlerSource};

pub trait VMHooksLog: VMHooksHandlerSource {
    fn managed_write_log(&self, topics_handle: RawHandle, data_handle: RawHandle) {
        let topics = self.m_types_lock().mb_get_vec_of_bytes(topics_handle);
        let single_data_field = self.m_types_lock().mb_get(data_handle).to_vec();
        self.push_tx_log(TxLog {
            address: self.current_address().clone(),
            endpoint: self.input_ref().func_name.clone(),
            topics,
            data: vec![single_data_field],
        });
    }
}