Skip to content

Commit

Permalink
Fix doc tests (#1387)
Browse files Browse the repository at this point in the history
  • Loading branch information
kpp authored Oct 29, 2024
1 parent db329d8 commit 57f9b46
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 36 deletions.
20 changes: 0 additions & 20 deletions crates/sovereign-sdk/full-node/sov-ledger-rpc/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,6 @@ const LEDGER_RPC_ERROR: &str = "LEDGER_RPC_ERROR";

/// Creates a new [`jsonrpsee::RpcModule`] that exposes all JSON-RPC methods
/// necessary to interface with the [`LedgerRpcProvider`].
///
/// # Example
/// ```
/// use sov_ledger_rpc::server::rpc_module;
/// use tempfile::tempdir;
/// use sov_db::ledger_db::LedgerDB;
///
/// /// Creates a new [`LedgerDB`] and starts serving JSON-RPC requests.
/// async fn rpc_server() -> jsonrpsee::server::ServerHandle {
/// let dir = tempdir().unwrap();
/// let db = LedgerDB::with_path(dir).unwrap();
/// let rpc_module = rpc_module::<LedgerDB, u32, u32>(db).unwrap();
///
/// let server = jsonrpsee::server::ServerBuilder::default()
/// .build("127.0.0.1:0")
/// .await
/// .unwrap();
/// server.start(rpc_module)
/// }
/// ```
pub fn rpc_module<T, B, Tx>(ledger: T) -> anyhow::Result<RpcModule<T>>
where
T: LedgerRpcProvider + Send + Sync + 'static,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub use sov_modules_macros::MessageCodec;
/// type Event = ();
///
/// fn call(
/// &self,
/// &mut self,
/// _msg: Self::CallMessage,
/// _context: &Self::Context,
/// _working_set: &mut WorkingSet<C>,
Expand Down Expand Up @@ -111,20 +111,6 @@ pub mod macros {
/// arguments for each of these structs.
///
/// To exclude a module from the CLI, use the `#[cli_skip]` attribute.
///
/// ## Examples
/// ```
/// use sov_modules_api::{Context, DispatchCall, MessageCodec};
/// use sov_modules_api::default_context::DefaultContext;
/// use sov_modules_api::macros::CliWallet;
///
/// #[derive(DispatchCall, MessageCodec, CliWallet)]
/// #[serialization(borsh::BorshDeserialize, borsh::BorshSerialize)]
/// pub struct Runtime<C: Context> {
/// pub bank: sov_bank::Bank<C>,
/// // ...
/// }
/// ```
#[cfg(feature = "native")]
pub use sov_modules_macros::CliWallet;
/// Implement [`CliWalletArg`](crate::CliWalletArg) for the annotated struct or enum. Unions are not supported.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use sov_modules_core::Witness;
/// ```
/// use sov_state::{ArrayWitness, Witness};
///
/// let witness = ArrayWitness::default();
/// let mut witness = ArrayWitness::default();
///
/// witness.add_hint(1u64);
/// witness.add_hint(2u64);
Expand Down

0 comments on commit 57f9b46

Please sign in to comment.