Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transform "unstable" example into an "new JSON-RPC" example #798

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ jobs:
staking_batch_payout,
subscribe_events,
sudo,
unstable_rpc_api_calls,
new_json_rpc_api_calls,
transfer_with_tungstenite_client,
transfer_with_ws_client,
author_tests,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,11 @@ async fn main() {
let json_string = serde_json::to_string(&json_value).unwrap();
println!("Available methods: {json_string} \n");

// Since it's an unstable api and might change anytime, we first check if our calls are still
// available:
let chain_name_request = "chainSpec_v1_chainName";
let chain_genesis_hash_request = "chainSpec_v1_genesisHash";
let transaction_submit_watch = "transactionWatch_v1_submitAndWatch";
let transaction_unwatch = "transactionWatch_v1_unwatch";

let request_vec = [
chain_name_request,
chain_genesis_hash_request,
transaction_submit_watch,
transaction_unwatch,
];
for request in request_vec {
if !json_string.contains(request) {
panic!("Api has changed, please update the call {request}.");
}
}

// Submit the above defiend rpc requests:
let chain_name: String = api.client().request(chain_name_request, rpc_params![]).await.unwrap();
println!("Our chain is called: {chain_name}");
Expand Down