Skip to content

Commit

Permalink
Merge pull request #1885 from oasisprotocol/kostko/feature/rofl-less-…
Browse files Browse the repository at this point in the history
…coupling

runtime-sdk/modules/rofl: Require consensus trust root implementation
  • Loading branch information
kostko authored Jul 16, 2024
2 parents b4feedd + d7c569a commit 1ddb024
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 1 addition & 3 deletions runtime-sdk/src/modules/rofl/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ pub trait App: Send + Sync + 'static {

/// Return the consensus layer trust root for this runtime; if `None`, consensus layer integrity
/// verification will not be performed.
fn consensus_trust_root() -> Option<TrustRoot> {
None
}
fn consensus_trust_root() -> Option<TrustRoot>;

/// Create a new unsigned transaction.
fn new_transaction<B>(&self, method: &str, body: B) -> transaction::Transaction
Expand Down
7 changes: 7 additions & 0 deletions tests/runtimes/components-rofl/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use async_trait::async_trait;

use oasis_runtime_sdk::{
self as sdk,
core::consensus::verifier::TrustRoot,
modules::rofl::app::{App, AppId, Environment},
Version,
};
Expand All @@ -25,6 +26,12 @@ impl App for TestApp {
*components_ronl::EXAMPLE_APP_ID
}

/// Return the consensus layer trust root for this runtime; if `None`, consensus layer integrity
/// verification will not be performed.
fn consensus_trust_root() -> Option<TrustRoot> {
None // Production apps should never use `None` as this is unsafe.
}

async fn run(self: Arc<Self>, _env: Environment<Self>) {
// We are running now!
println!("Hello ROFL world!");
Expand Down

0 comments on commit 1ddb024

Please sign in to comment.