Skip to content

Commit 872359d

Browse files
JoshOrndorff4meta5
andauthored
Clean interfaces and docs (paritytech#290)
* Don't re-export frame-support stuff * Docs for GLMR constant * Docs for modules in node crate Co-authored-by: Amar Singh <asinghchrony@protonmail.com>
1 parent 084ddff commit 872359d

File tree

5 files changed

+26
-7
lines changed

5 files changed

+26
-7
lines changed

node/src/chain_spec.rs

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313

1414
// You should have received a copy of the GNU General Public License
1515
// along with Moonbeam. If not, see <http://www.gnu.org/licenses/>.
16+
17+
//! Moonbeam Chain Specifications and utilities for building them.
18+
//!
19+
//! Learn more about Substrate chain specifications at
20+
//! https://substrate.dev/docs/en/knowledgebase/integrate/chain-spec
21+
1622
use bip39::{Language, Mnemonic, Seed};
1723
use cumulus_primitives::ParaId;
1824
use log::debug;

node/src/cli.rs

+5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with Moonbeam. If not, see <http://www.gnu.org/licenses/>.
1616

17+
//! Moonbeam CLI Library. Built with structopt
18+
//!
19+
//! This module defines the Moonbeam node's Command Line Interface (CLI)
20+
//! It is built using structopt and inherits behavior from Substrate's sc_cli crate.
21+
1722
use sp_core::H160;
1823
use std::path::PathBuf;
1924
use std::str::FromStr;

node/src/command.rs

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with Moonbeam. If not, see <http://www.gnu.org/licenses/>.
1616

17+
//! This module constructs and executes the appropriate service components for the given subcommand
18+
1719
use crate::{
1820
chain_spec,
1921
cli::{Cli, RelayChainCli, Subcommand},

node/src/service.rs

+8
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with Moonbeam. If not, see <http://www.gnu.org/licenses/>.
1616

17+
//! This module assembles the Moonbeam service components, executes them, and manages communication
18+
//! between them. This is the backbone of the client-side node implementation.
19+
//!
20+
//! This module can assemble:
21+
//! PartialComponents: For maintence tasks without a complete node (eg import/export blocks, purge)
22+
//! Full Service: A complete parachain node including the pool, rpc, network, embedded relay chain
23+
//! Dev Service: A leaner service without the relay chain backing.
24+
1725
use crate::{cli::Sealing, inherents::build_inherent_data_providers};
1826
use async_io::Timer;
1927
use cumulus_network::build_block_announce_validator;

runtime/src/lib.rs

+5-7
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,12 @@
2929
include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
3030

3131
use fp_rpc::TransactionStatus;
32-
pub use frame_support::{
32+
use frame_support::{
3333
construct_runtime,
3434
pallet_prelude::PhantomData,
3535
parameter_types,
36-
traits::{FindAuthor, Get, Randomness},
36+
traits::{Get, Randomness},
3737
weights::{constants::WEIGHT_PER_SECOND, IdentityFee, Weight},
38-
ConsensusEngineId, StorageValue,
3938
};
4039
use frame_system::{EnsureNever, EnsureRoot, EnsureSigned};
4140
use pallet_ethereum::Call::transact;
@@ -52,7 +51,7 @@ use sp_runtime::{
5251
create_runtime_str, generic, impl_opaque_keys,
5352
traits::{BlakeTwo256, Block as BlockT, IdentifyAccount, IdentityLookup, Verify},
5453
transaction_validity::{TransactionSource, TransactionValidity},
55-
ApplyExtrinsicResult,
54+
ApplyExtrinsicResult, Perbill,
5655
};
5756
use sp_std::{convert::TryFrom, prelude::*};
5857
#[cfg(feature = "std")]
@@ -61,7 +60,6 @@ use sp_version::RuntimeVersion;
6160

6261
#[cfg(any(feature = "std", test))]
6362
pub use sp_runtime::BuildStorage;
64-
pub use sp_runtime::{Perbill, Permill};
6563

6664
/// An index to a block.
6765
pub type BlockNumber = u32;
@@ -284,7 +282,7 @@ impl pallet_scheduler::Config for Runtime {
284282
type WeightInfo = ();
285283
}
286284

287-
pub const BLOCKS_PER_DAY: BlockNumber = 24 * 60 * 10;
285+
const BLOCKS_PER_DAY: BlockNumber = 24 * 60 * 10;
288286

289287
parameter_types! {
290288
pub const LaunchPeriod: BlockNumber = BLOCKS_PER_DAY;
@@ -378,7 +376,7 @@ impl cumulus_parachain_system::Config for Runtime {
378376

379377
impl parachain_info::Config for Runtime {}
380378

381-
// 18 decimals
379+
/// GLMR, the native token, uses 18 decimals of precision.
382380
pub const GLMR: Balance = 1_000_000_000_000_000_000;
383381

384382
parameter_types! {

0 commit comments

Comments
 (0)