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

test(spec_version): ✅ tested starknet_specversion #33

Merged
merged 2 commits into from
Jan 12, 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: 2 additions & 0 deletions unit_tests/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,5 @@ pub const SELECTOR_NAME: &str = "";

pub const ERR_DEOXYS: &str = "Error waiting for response from Deoxys client";
pub const ERR_PATHFINDER: &str = "Error waiting for response from Pathfinder client";

pub const RPC_SPEC: &str = "0.5.1";
21 changes: 21 additions & 0 deletions unit_tests/tests/test_specversion.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#![feature(assert_matches)]

mod common;
use common::*;
use starknet_providers::{jsonrpc::HttpTransport, JsonRpcClient, Provider};

///
/// Unit test for `starknet_specversion`
///
/// purpose: retrieve the Deoxys node spec version
/// success case: spec version should be 0.5.1
///
#[rstest]
#[tokio::test]
#[logging]
async fn test_specversion(deoxys: JsonRpcClient<HttpTransport>) {
let response_deoxys = deoxys.spec_version().await.expect(ERR_DEOXYS);

log::info!("Deoxys RPC spec: {}", response_deoxys);
assert_eq!(response_deoxys, RPC_SPEC);
}
Loading