Skip to content

Commit

Permalink
Merge pull request #33 from Trantorian1/test/specversion
Browse files Browse the repository at this point in the history
test(spec_version): ✅ tested starknet_specversion
  • Loading branch information
antiyro authored Jan 12, 2024
2 parents 272a25b + ebb89af commit 7cf53ea
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
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);
}

0 comments on commit 7cf53ea

Please sign in to comment.