-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
runtime-sdk: Add support for incoming messages
- Loading branch information
Showing
24 changed files
with
902 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use crate::modules; | ||
|
||
/// Incoming message handler configuration. | ||
pub trait Config: 'static { | ||
/// The accounts module to use. | ||
type Accounts: modules::accounts::API; | ||
/// The consensus module to use. | ||
type Consensus: modules::consensus::API; | ||
|
||
/// Maximum number of outgoing consensus message slots that an incoming message can claim. | ||
/// | ||
/// When this is configured to be greater than zero it allows incoming messages to also emit | ||
/// consensus messages as a result of executing a transaction. | ||
const MAX_CONSENSUS_MSG_SLOTS_PER_TX: u32 = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use super::MODULE_NAME; | ||
use crate::error; | ||
|
||
/// Events emitted by the consensus incoming message handler module. | ||
#[derive(Debug, cbor::Encode, oasis_runtime_sdk_macros::Event)] | ||
#[cbor(untagged)] | ||
pub enum Event { | ||
#[sdk_event(code = 1)] | ||
Processed { | ||
id: u64, | ||
#[cbor(optional)] | ||
tag: u64, | ||
#[cbor(optional)] | ||
error: Option<error::SerializableError>, | ||
}, | ||
} |
Oops, something went wrong.