Skip to content

Commit

Permalink
refactor: rename CallParachain struct into Call
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexD10S committed Dec 10, 2024
1 parent 424a9e1 commit 6391d28
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions crates/pop-cli/src/commands/call/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ impl CallChainCommand {
}

// Configure the call based on command line arguments/call UI.
fn configure_call(&mut self, chain: &Chain, cli: &mut impl Cli) -> Result<CallParachain> {
fn configure_call(&mut self, chain: &Chain, cli: &mut impl Cli) -> Result<Call> {
loop {
// Resolve pallet.
let pallet = match self.pallet {
Expand Down Expand Up @@ -199,7 +199,7 @@ impl CallChainCommand {
cli.input("Signer of the extrinsic:").default_input(DEFAULT_URI).interact()?,
};

return Ok(CallParachain {
return Ok(Call {
function: function.clone(),
args,
suri,
Expand Down Expand Up @@ -317,7 +317,7 @@ struct Chain {
/// Represents a configured dispatchable function call, including the pallet, function, arguments,
/// and signing options.
#[derive(Clone)]
struct CallParachain {
struct Call {
/// The dispatchable function to execute.
function: Function,
/// The dispatchable function arguments, encoded as strings.
Expand All @@ -334,7 +334,7 @@ struct CallParachain {
sudo: bool,
}

impl CallParachain {
impl Call {
// Prepares the extrinsic.
fn prepare_extrinsic(
&self,
Expand Down Expand Up @@ -700,7 +700,7 @@ mod tests {
#[tokio::test]
async fn prepare_extrinsic_works() -> Result<()> {
let client = set_up_client(POP_NETWORK_TESTNET_URL).await?;
let mut call_config = CallParachain {
let mut call_config = Call {
function: Function {
pallet: "WrongName".to_string(),
name: "WrongName".to_string(),
Expand Down Expand Up @@ -743,7 +743,7 @@ mod tests {
async fn user_cancel_submit_extrinsic_works() -> Result<()> {
let client = set_up_client(POP_NETWORK_TESTNET_URL).await?;
let pallets = parse_chain_metadata(&client)?;
let mut call_config = CallParachain {
let mut call_config = Call {
function: find_dispatchable_by_name(&pallets, "System", "remark")?.clone(),
args: vec!["0x11".to_string()].to_vec(),
suri: DEFAULT_URI.to_string(),
Expand Down

0 comments on commit 6391d28

Please sign in to comment.