Skip to content

Commit

Permalink
test: use a live network endpoint for the test
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexD10S committed Feb 14, 2025
1 parent f485054 commit 0774706
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions crates/pop-parachains/src/call/metadata/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ fn type_to_param(name: &str, registry: &PortableRegistry, type_id: u32) -> Resul
let type_info = registry
.resolve(type_id)
.ok_or_else(|| Error::MetadataParsingError(name.to_string()))?;
// Check for unsupported `RuntimeCall` type
if type_info.path.segments.contains(&"RuntimeCall".to_string()) {
return Err(Error::FunctionNotSupported);
}
Expand Down Expand Up @@ -235,13 +236,19 @@ mod tests {
field_to_param(&metadata, &function.fields.first().unwrap()),
Err(Error::FunctionNotSupported)
));
// TODO: Uncomment this test once the Pop Network mainnet (or the same runtime in testnet)
// is live. let function =
// metadata.pallet_by_name("Council").unwrap().call_variant_by_name("execute").unwrap();
// assert!(matches!(
// field_to_param(&metadata, &function.fields.first().unwrap()),
// Err(Error::FunctionNotSupported)
// ));
// TODO: Use the Pop Network endpoint once the mainnet (or an equivalent testnet with the
// same runtime) is available.
let client = set_up_client("wss://mythos.ibp.network").await?;
let metadata = client.metadata();
let function = metadata
.pallet_by_name("Council")
.unwrap()
.call_variant_by_name("execute")
.unwrap();
assert!(matches!(
field_to_param(&metadata, &function.fields.first().unwrap()),
Err(Error::FunctionNotSupported)
));

Ok(())
}
Expand Down

0 comments on commit 0774706

Please sign in to comment.