Skip to content

Commit

Permalink
update runtime api tests
Browse files Browse the repository at this point in the history
  • Loading branch information
haerdib committed Jan 23, 2025
1 parent 47f3970 commit ab8da29
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion examples/async/examples/query_runtime_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ use substrate_api_client::{
Api, GetChainInfo,
};

const UNSTABLE_METADATA_VERSION: u32 = u32::MAX;

// To test this example with CI we run it against the Polkadot Rococo node. Remember to switch the Config to match your
// own runtime if it uses different parameter configurations. Several pre-compiled runtimes are available in the ac-primitives crate.

Expand Down Expand Up @@ -64,7 +66,7 @@ async fn main() {

// Query the available metadata versions.
let metadata_versions = runtime_api.metadata_versions(None).await.unwrap();
assert_eq!(metadata_versions, [14, 15]);
assert_eq!(metadata_versions, [14, 15, UNSTABLE_METADATA_VERSION]);

// List all apis and functions thereof.
let trait_names = runtime_api.list_traits(None).await.unwrap();
Expand Down
4 changes: 3 additions & 1 deletion testing/async/examples/runtime_api_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ use substrate_api_client::{
Api, GetChainInfo,
};

const UNSTABLE_METADATA_VERSION: u32 = u32::MAX;

#[tokio::main]
async fn main() {
// Setup
Expand Down Expand Up @@ -73,7 +75,7 @@ async fn main() {
let _method_names = runtime_api.list_methods_of_trait("BabeApi", None).await.unwrap();
let _trait_names = runtime_api.list_traits(None).await.unwrap();
let metadata_versions = runtime_api.metadata_versions(None).await.unwrap();
assert_eq!(metadata_versions, [14, 15]);
assert_eq!(metadata_versions, [14, 15, UNSTABLE_METADATA_VERSION]);

// MMR
// This doesn't seem to work with the current substrate node. Tried it on polkadot.js aswell, but it keeps on runtime panicking.
Expand Down

0 comments on commit ab8da29

Please sign in to comment.