Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
I
ink
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
parity
ink
Commits
5d7bc08f
Commit
5d7bc08f
authored
Feb 18, 2019
by
Hero Bird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[pdsl_model] Some minor clean ups
parent
5f5e5343
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
38 deletions
+1
-38
model/src/lib.rs
model/src/lib.rs
+1
-1
model/src/msg_handler.rs
model/src/msg_handler.rs
+0
-37
No files found.
model/src/lib.rs
View file @
5d7bc08f
...
...
@@ -16,7 +16,7 @@ mod contract;
mod
exec_env
;
mod
msg_handler
;
mod
test
;
//
mod test;
pub
use
crate
::{
state
::{
...
...
model/src/msg_handler.rs
View file @
5d7bc08f
...
...
@@ -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()
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment