Skip to content

Commit b16ffae

Browse files
authored
CI: Update tests as frame_metadata v16 has been stabilized (#869)
1 parent afc00e8 commit b16ffae

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

examples/async/examples/query_runtime_api.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ use substrate_api_client::{
2626
Api, GetChainInfo,
2727
};
2828

29-
const UNSTABLE_METADATA_VERSION: u32 = u32::MAX;
30-
3129
// To test this example with CI we run it against the Polkadot Rococo node. Remember to switch the Config to match your
3230
// own runtime if it uses different parameter configurations. Several pre-compiled runtimes are available in the ac-primitives crate.
3331

@@ -66,7 +64,7 @@ async fn main() {
6664

6765
// Query the available metadata versions.
6866
let metadata_versions = runtime_api.metadata_versions(None).await.unwrap();
69-
assert_eq!(metadata_versions, [14, 15, UNSTABLE_METADATA_VERSION]);
67+
assert_eq!(metadata_versions, [14, 15, 16]);
7068

7169
// List all apis and functions thereof.
7270
let trait_names = runtime_api.list_traits(None).await.unwrap();

testing/async/examples/runtime_api_tests.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,11 @@ use substrate_api_client::{
2323
rpc::JsonrpseeClient,
2424
runtime_api::{
2525
AccountNonceApi, AuthorityDiscoveryApi, BlockBuilderApi, CoreApi, MetadataApi, RuntimeApi,
26-
StakingApi, TransactionPaymentApi, TransactionPaymentCallApi,
26+
TransactionPaymentApi,
2727
},
2828
Api, GetChainInfo,
2929
};
3030

31-
const UNSTABLE_METADATA_VERSION: u32 = u32::MAX;
32-
3331
#[tokio::main]
3432
async fn main() {
3533
// Setup
@@ -46,7 +44,7 @@ async fn main() {
4644
// General Runtime Api
4745
let bytes = runtime_api.rpc_call("Metadata_metadata_versions", None, None).await.unwrap();
4846
let metadata_versions = Vec::<u32>::decode(&mut bytes.0.as_slice()).unwrap();
49-
assert_eq!(metadata_versions, [14, 15, UNSTABLE_METADATA_VERSION]);
47+
assert_eq!(metadata_versions, [14, 15, 16]);
5048

5149
// AccountNonce
5250
let alice_nonce = runtime_api.account_nonce(alice, None).await.unwrap();
@@ -75,7 +73,7 @@ async fn main() {
7573
let _method_names = runtime_api.list_methods_of_trait("BabeApi", None).await.unwrap();
7674
let _trait_names = runtime_api.list_traits(None).await.unwrap();
7775
let metadata_versions = runtime_api.metadata_versions(None).await.unwrap();
78-
assert_eq!(metadata_versions, [14, 15, UNSTABLE_METADATA_VERSION]);
76+
assert_eq!(metadata_versions, [14, 15, 16]);
7977

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

0 commit comments

Comments
 (0)