diff --git a/unit_tests/src/constants.rs b/unit_tests/src/constants.rs index e8efaec..c4a9e5c 100644 --- a/unit_tests/src/constants.rs +++ b/unit_tests/src/constants.rs @@ -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"; diff --git a/unit_tests/tests/test_specversion.rs b/unit_tests/tests/test_specversion.rs new file mode 100644 index 0000000..daedcee --- /dev/null +++ b/unit_tests/tests/test_specversion.rs @@ -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) { + let response_deoxys = deoxys.spec_version().await.expect(ERR_DEOXYS); + + log::info!("Deoxys RPC spec: {}", response_deoxys); + assert_eq!(response_deoxys, RPC_SPEC); +}