Skip to content

Commit

Permalink
test: fix decode_call_data_works unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexD10S committed Dec 9, 2024
1 parent 275ae43 commit 48bfda9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions crates/pop-cli/src/commands/call/parachain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,7 @@ mod tests {
url: Some(Url::parse("wss://rpc1.paseo.popnetwork.xyz")?),
suri: Some(DEFAULT_URI.to_string()),
skip_confirm: false,
call_data: None,
};
assert_eq!(
call_config.expand_file_arguments()?,
Expand Down
4 changes: 3 additions & 1 deletion crates/pop-parachains/src/call/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ mod tests {
async fn decode_call_data_works() -> Result<()> {
assert!(matches!(decode_call_data("wrongcalldata"), Err(Error::CallDataDecodingError(..))));
let client = set_up_client("wss://rpc1.paseo.popnetwork.xyz").await?;
let extrinsic = construct_extrinsic("System", "remark", vec!["0x11".to_string()]).await?;
let pallets = parse_chain_metadata(&client).await?;
let remark = find_extrinsic_by_name(&pallets, "System", "remark").await?;
let extrinsic = construct_extrinsic("System", &remark, vec!["0x11".to_string()]).await?;
let expected_call_data = extrinsic.encode_call_data(&client.metadata())?;
assert_eq!(decode_call_data("0x00000411")?, expected_call_data);
Ok(())
Expand Down

0 comments on commit 48bfda9

Please sign in to comment.