Commit 5d7bc08f authored by Hero Bird's avatar Hero Bird

[pdsl_model] Some minor clean ups

parent 5f5e5343
......@@ -16,7 +16,7 @@ mod contract;
mod exec_env;
mod msg_handler;
mod test;
// mod test;
pub use crate::{
state::{
......
......@@ -104,43 +104,6 @@ where
/// Returns the associated handler selector.
pub const fn selector() -> MessageHandlerSelector {
<Msg as Message>::ID
// Should produce a hash out of a byte sequence
// that contains signatures of the following parts:
//
// - State::NAME
// - Msg::NAME
// - Msg::Input
// - Msg::Output
//
// # Structure
//
// State::NAME
// ~ b'0xFF' ~ Msg::NAME
// ~ $( b'0xFE' ~ Msg::Input::type_byte_seq() ~ b'0xFD' )*
// ~ b'0xFD' ~ Msg::Output::type_byte_seq()
//
// Where ~ is the byte concat operator.
// Note that State::NAME, Msg::NAME and everything returned
// from T::type_byte_seq must be valid ascii so the guard
// patterns (b'0xFF', b'0xFE', b'0xFD') are unique.
//
// Afterwards we hash this sequence by a const hasher
// to retrieve the resulting MessageHandlerSelector.
//
// # Example
//
// With State being
//
// struct Adder { ... }
//
// and Msg being
//
// Inc(by: u32) -> u32;
//
// We have the following byte sequence:
//
// Adder 0xFF Inc 0xFE i32::type_byte_seq() 0xFD i32::type_byte_seq()
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment