Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs for the value-setter module #610

Merged
merged 5 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ It demonstrates the following concepts:

### 2. Functionality:

The `admin` (specified in the `ValueSetter` genesis) can update a single `u32` value by creating `CallMessage::SetValue(new_value)` message. Any other module can query the module state by invoking the `get_value` function.
The `admin` (specified in the `ValueSetter` genesis) can update a single `u32` value by creating `CallMessage::SetValue(new_value)` message. Anyone can query the module state by calling the `valueSetter_queryValue` endpoint.

For implementation details, please check comments in the `genesis.rs, call.rs & query.rs`.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![deny(missing_docs)]
bkolad marked this conversation as resolved.
Show resolved Hide resolved
#![doc = include_str!("../README.md")]
mod call;
mod genesis;

Expand All @@ -13,7 +15,9 @@ pub use query::{Response, ValueSetterRpcImpl, ValueSetterRpcServer};
use sov_modules_api::{Error, ModuleInfo};
use sov_state::WorkingSet;

/// Initial configuration for sov-value-setter module.
pub struct ValueSetterConfig<C: sov_modules_api::Context> {
/// Admin of the module.
pub admin: C::Address,
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#![allow(missing_docs)]
use jsonrpsee::core::RpcResult;
use sov_modules_api::macros::rpc_gen;
use sov_state::WorkingSet;

use super::ValueSetter;

/// Response returned from the valueSetter_queryValue endpoint.
#[derive(serde::Serialize, serde::Deserialize, Debug, Eq, PartialEq, Clone)]
pub struct Response {
/// Value saved in the module state.
pub value: Option<u32>,
}

Expand Down