hooks_rs::api

Function insert_etxn_details_from_ptr

Source
pub fn insert_etxn_details_from_ptr(
    txn_buffer_mut_ptr: u32,
    emit_details_len: u32,
) -> Result<u64>
Expand description

Produce emit details for for a soon-to-be emitted transaction. Normally, it is appended at the end of the transaction buffer.

ยงExample

let buf_mut_ptr: *mut MaybeUninit<u8> = buf.as_mut_ptr();
let pos = 45;
let insert_etxn_details_from_ptr_result: Result<u64> = insert_etxn_details_from_ptr(unsafe { buf_mut_ptr.add(pos) as u32 }, 138);
match insert_etxn_details_from_ptr_result {
    Err(e) => return Err(e),
    Ok(_) => {}
}