From b1ffb3305864741a4c9e963f8f13f1941510c112 Mon Sep 17 00:00:00 2001 From: bkolad Date: Sun, 8 Oct 2023 13:36:15 +0200 Subject: [PATCH] Make app a private module --- .../demo-prover/methods/guest-celestia/src/bin/rollup.rs | 4 ++-- .../demo-prover/methods/guest-mock/src/bin/mock_da.rs | 4 ++-- examples/demo-rollup/src/register_rpc.rs | 2 +- examples/demo-rollup/src/rollup.rs | 8 ++++---- examples/demo-stf/src/lib.rs | 7 +++++-- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/examples/demo-prover/methods/guest-celestia/src/bin/rollup.rs b/examples/demo-prover/methods/guest-celestia/src/bin/rollup.rs index 729d0d734..0b3815020 100644 --- a/examples/demo-prover/methods/guest-celestia/src/bin/rollup.rs +++ b/examples/demo-prover/methods/guest-celestia/src/bin/rollup.rs @@ -3,10 +3,10 @@ #![no_main] use const_rollup_config::ROLLUP_NAMESPACE_RAW; -use demo_stf::app::create_zk_app_template; +use demo_stf::create_zk_app_template; +use demo_stf::AppVerifier; use sov_celestia_adapter::types::NamespaceId; use sov_celestia_adapter::verifier::CelestiaVerifier; -use demo_stf::AppVerifier; use sov_risc0_adapter::guest::Risc0Guest; // The rollup stores its data in the namespace b"sov-test" on Celestia diff --git a/examples/demo-prover/methods/guest-mock/src/bin/mock_da.rs b/examples/demo-prover/methods/guest-mock/src/bin/mock_da.rs index dc24324a0..0de5a4288 100644 --- a/examples/demo-prover/methods/guest-mock/src/bin/mock_da.rs +++ b/examples/demo-prover/methods/guest-mock/src/bin/mock_da.rs @@ -1,6 +1,6 @@ #![no_main] -use demo_stf::app::create_zk_app_template; +use demo_stf::create_zk_app_template; use demo_stf::AppVerifier; use sov_risc0_adapter::guest::Risc0Guest; @@ -13,7 +13,7 @@ pub fn main() { let mut stf_verifier = AppVerifier::new(create_zk_app_template::(), MockDaVerifier {}); - + stf_verifier .run_block(guest) .expect("Prover must be honest"); diff --git a/examples/demo-rollup/src/register_rpc.rs b/examples/demo-rollup/src/register_rpc.rs index 57d1a340b..9f119dc69 100644 --- a/examples/demo-rollup/src/register_rpc.rs +++ b/examples/demo-rollup/src/register_rpc.rs @@ -1,7 +1,7 @@ //! Full-Node specific RPC methods. use anyhow::Context; -use demo_stf::app::App; +use demo_stf::App; use sov_celestia_adapter::verifier::address::CelestiaAddress; use sov_db::ledger_db::LedgerDB; #[cfg(feature = "experimental")] diff --git a/examples/demo-rollup/src/rollup.rs b/examples/demo-rollup/src/rollup.rs index a17edb1fa..c25c68e10 100644 --- a/examples/demo-rollup/src/rollup.rs +++ b/examples/demo-rollup/src/rollup.rs @@ -4,12 +4,10 @@ use std::str::FromStr; use anyhow::Context; use const_rollup_config::SEQUENCER_DA_ADDRESS; -#[cfg(feature = "experimental")] -use demo_stf::app::DefaultPrivateKey; -use demo_stf::app::{create_zk_app_template, App, DefaultContext}; use demo_stf::genesis_config::{get_genesis_config, GenesisPaths, StorageConfig}; use demo_stf::runtime::{get_rpc_methods, GenesisConfig, Runtime}; -use demo_stf::AppVerifier; +use demo_stf::{create_zk_app_template, App, AppVerifier, DefaultContext}; + #[cfg(feature = "experimental")] use secp256k1::SecretKey; use sov_celestia_adapter::verifier::address::CelestiaAddress; @@ -21,6 +19,8 @@ use sov_db::ledger_db::LedgerDB; #[cfg(feature = "experimental")] use sov_ethereum::experimental::EthRpcConfig; use sov_modules_api::default_context::ZkDefaultContext; +#[cfg(feature = "experimental")] +use sov_modules_api::default_signature::private_key::DefaultPrivateKey; use sov_modules_stf_template::AppTemplate; use sov_rollup_interface::mocks::{ MockAddress, MockDaConfig, MockDaService, MOCK_SEQUENCER_DA_ADDRESS, diff --git a/examples/demo-stf/src/lib.rs b/examples/demo-stf/src/lib.rs index c5a640213..398e71d53 100644 --- a/examples/demo-stf/src/lib.rs +++ b/examples/demo-stf/src/lib.rs @@ -1,4 +1,8 @@ -pub mod app; +//#![deny(missing_docs)] +//#![doc = include_str!("../README.md")] + +mod app; +pub use app::*; #[cfg(feature = "native")] pub mod genesis_config; @@ -11,7 +15,6 @@ pub mod tests; pub mod cli; use runtime::Runtime; -use sov_modules_api::default_context::ZkDefaultContext; use sov_modules_stf_template::AppTemplate; use sov_rollup_interface::da::DaVerifier; pub use sov_state::ArrayWitness;