v0.2.7-pre.012
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-config-lib/unit_tests/transport.rs
|
||||
// version: 3
|
||||
// version: 4
|
||||
|
||||
#[test]
|
||||
fn fixture_transport_profile_maps_complete_runtime_contract() {
|
||||
@@ -122,6 +122,30 @@ fn committed_transport_document_maps_default_and_explicit_profiles() {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn committed_v2_websocket_endpoint_composes_with_public_session_constructor_without_polling() {
|
||||
let engine = committed_engine();
|
||||
let engine = match engine {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(_) => return,
|
||||
};
|
||||
let environment = crate::ConfigEnvironment::from_maps(std::collections::BTreeMap::new(), std::collections::BTreeMap::new());
|
||||
let resolved = engine.load_resolved_transport_config(std::option::Option::Some("devnet_public"), &environment);
|
||||
assert!(resolved.is_ok(), "committed V2 Transport profile should map: {resolved:?}");
|
||||
if let std::result::Result::Ok(resolved) = resolved {
|
||||
let (http, ws) = resolved.into_transport_settings();
|
||||
assert_eq!(http.endpoints().len(), 1);
|
||||
assert!(ws.is_some(), "committed V2 Transport profile should expose WebSocket settings");
|
||||
if let std::option::Option::Some(ws) = ws {
|
||||
assert!(ws.validate().is_ok(), "Config-produced WebSocket settings should satisfy Transport validation");
|
||||
assert_eq!(ws.endpoints().len(), 1);
|
||||
let endpoint = ws.endpoints()[0].clone();
|
||||
assert_eq!(endpoint.protocol(), ksp_onchain_transport_lib::WsProtocolKind::SolanaStandard);
|
||||
let _connect_future = ksp_onchain_transport_lib::WsSession::connect(endpoint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn transport_profile_preserves_global_and_profile_origin() {
|
||||
let engine = committed_engine();
|
||||
|
||||
Reference in New Issue
Block a user