use std::fmt::Debug;
use oasis_core_runtime::consensus;
pub type MessageEvent = consensus::roothash::MessageEvent;
#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
#[cbor(no_default)]
pub struct MessageEventHookInvocation {
pub hook_name: String,
pub payload: cbor::Value,
}
impl MessageEventHookInvocation {
pub fn new<S: cbor::Encode>(name: String, payload: S) -> Self {
Self {
hook_name: name,
payload: cbor::to_value(payload),
}
}
}
#[derive(Clone, Debug)]
pub struct MessageResult {
pub event: MessageEvent,
pub context: cbor::Value,
}