Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
subcommand moduleid to palletid
  • Loading branch information
aurexav committed Apr 7, 2021
commit 36eb97882e4a0cbef39f90b83a9fca0192388b8d
4 changes: 2 additions & 2 deletions utils/frame/frame-utilities-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

//! frame-system CLI utilities

mod module_id;
mod pallet_id;

pub use module_id::ModuleIdCmd;
pub use pallet_id::PalletIdCmd;

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//! Implementation of the `moduleid` subcommand
//! Implementation of the `palletid` subcommand

use sc_cli::{
Error, utils::print_from_uri, CryptoSchemeFlag,
Expand All @@ -27,13 +27,13 @@ use std::convert::{TryInto, TryFrom};
use structopt::StructOpt;
use frame_support::PalletId;

/// The `moduleid` command
/// The `palletid` command
#[derive(Debug, StructOpt)]
#[structopt(
name = "moduleid",
name = "palletid",
about = "Inspect a module ID address"
)]
pub struct ModuleIdCmd {
pub struct PalletIdCmd {
/// The module ID used to derive the account
id: String,

Expand All @@ -60,7 +60,7 @@ pub struct ModuleIdCmd {
pub keystore_params: KeystoreParams,
}

impl ModuleIdCmd {
impl PalletIdCmd {
/// runs the command
pub fn run<R>(&self) -> Result<(), Error>
where
Expand All @@ -74,7 +74,7 @@ impl ModuleIdCmd {

let id_fixed_array: [u8; 8] = self.id.as_bytes()
.try_into()
.map_err(|_| "Cannot convert argument to moduleid: argument should be 8-character string")?;
.map_err(|_| "Cannot convert argument to palletid: argument should be 8-character string")?;

let account_id: R::AccountId = PalletId(id_fixed_array).into_account();

Expand Down