Skip to content

Commit

Permalink
docs: improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexD10S committed Dec 9, 2024
1 parent 2eb5183 commit 69410bd
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
10 changes: 5 additions & 5 deletions crates/pop-cli/src/commands/call/parachain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl CallParachainCommand {
/// Executes the command.
pub(crate) async fn execute(mut self) -> Result<()> {
let mut cli = cli::Cli;
// Check if all fields are specified via command line argument.
// Check if all fields are specified via the command line.
let prompt_to_repeat_call = self.requires_user_input();
// Configure the chain.
let chain = self.configure_chain(&mut cli).await?;
Expand Down Expand Up @@ -207,13 +207,13 @@ impl CallParachainCommand {
}
}

/// Represents a chain, including its URL, client connection, and available pallets.
// Represents a chain, including its URL, client connection, and available pallets.
struct Chain {
/// Websocket endpoint of the node.
// Websocket endpoint of the node.
url: Url,
/// The client used to interact with the chain.
// The client used to interact with the chain.
client: OnlineClient<SubstrateConfig>,
/// A list of pallets available on the chain.
// A list of pallets available on the chain.
pallets: Vec<Pallet>,
}

Expand Down
3 changes: 3 additions & 0 deletions crates/pop-common/src/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ use crate::errors::Error;
use subxt_signer::{sr25519::Keypair, SecretUri};

/// Create a Signer from a secret URI.
///
/// # Arguments
/// `suri` - Secret URI string used to generate the `Keypair`.
pub fn create_signer(suri: &str) -> Result<Keypair, Error> {
let uri = <SecretUri as std::str::FromStr>::from_str(suri)
.map_err(|e| Error::ParseSecretURI(format!("{}", e)))?;
Expand Down
2 changes: 1 addition & 1 deletion crates/pop-parachains/src/call/metadata/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ impl Action {
/// Fetch the list of supported actions based on available pallets.
///
/// # Arguments
/// * `pallets`: List of pallets availables in the chain.
/// * `pallets`: Supported pallets.
pub async fn supported_actions(pallets: &[Pallet]) -> Vec<Action> {
let mut actions = Vec::new();
for action in Action::VARIANTS.iter() {
Expand Down
4 changes: 2 additions & 2 deletions crates/pop-parachains/src/call/metadata/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl Display for Pallet {
}
}

/// Represents an extrinsic in a pallet.
/// Represents an extrinsic.
#[derive(Clone, PartialEq, Eq, Debug)]
pub struct Extrinsic {
/// The name of the extrinsic.
Expand All @@ -49,7 +49,7 @@ impl Display for Extrinsic {
/// parameters.
///
/// # Arguments
/// * `client`:`client` - The client used to interact with the chain.
/// * `client`: The client to interact with the chain.
pub async fn parse_chain_metadata(
client: &OnlineClient<SubstrateConfig>,
) -> Result<Vec<Pallet>, Error> {
Expand Down
6 changes: 3 additions & 3 deletions crates/pop-parachains/src/call/metadata/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ pub struct Param {
/// Transforms a metadata field into its `Param` representation.
///
/// # Arguments
/// * `client`: `client` - The client used to interact with the chain.
/// * `field`: A reference to a metadata field of the extrinsic.
/// * `client`: The client to interact with the chain.
/// * `field`: A parameter of an extrinsic as struct field.
pub fn field_to_param(
client: &OnlineClient<SubstrateConfig>,
field: &Field<PortableForm>,
Expand All @@ -46,7 +46,7 @@ pub fn field_to_param(
///
/// # Arguments
/// * `name`: The name of the parameter.
/// * `registry`: A reference to the `PortableRegistry` to resolve type dependencies.
/// * `registry`: Type registry containing all types used in the metadata.
/// * `type_id`: The ID of the type to be converted.
fn type_to_param(name: String, registry: &PortableRegistry, type_id: u32) -> Result<Param, Error> {
let type_info = registry.resolve(type_id).ok_or(Error::MetadataParsingError(name.clone()))?;
Expand Down

0 comments on commit 69410bd

Please sign in to comment.