v0.2.4-pre.002
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// file: crates/ksp-onchain-transport-lib/tests/release_completeness.rs
|
||||
// version: 13
|
||||
// version: 14
|
||||
|
||||
//! Release-level completeness canaries for the `0.2.1` HTTP foundation contract.
|
||||
//! Release-level completeness canaries for the staged HTTP wrapper sequence.
|
||||
|
||||
#[test]
|
||||
fn release_registry_partition_matches_the_audited_http_plan() {
|
||||
@@ -430,3 +430,44 @@ fn release_pre_008_ksp_transport_007_retro_audit_covers_all_typed_current_method
|
||||
let get_transaction = ksp_onchain_transport_lib::find_http_rpc_method("getTransaction").expect("getTransaction descriptor must exist");
|
||||
assert!(get_transaction.request_form_status().has_deprecated_legacy());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn release_v0_2_4_descriptor_set_is_exact_and_remains_read_retry_safe_before_wrappers() {
|
||||
let mut expected_blocks = std::vec![
|
||||
"getBlock",
|
||||
"getBlockCommitment",
|
||||
"getBlockHeight",
|
||||
"getBlockProduction",
|
||||
"getBlocks",
|
||||
"getBlocksWithLimit",
|
||||
"getBlockTime",
|
||||
"getFirstAvailableBlock",
|
||||
"getRecentPerformanceSamples",
|
||||
"minimumLedgerSlot",
|
||||
];
|
||||
let mut expected_economics = std::vec!["getInflationGovernor", "getInflationRate", "getInflationReward", "getStakeMinimumDelegation", "getSupply",];
|
||||
let mut actual_blocks = std::vec::Vec::new();
|
||||
let mut actual_economics = std::vec::Vec::new();
|
||||
for descriptor in ksp_onchain_transport_lib::current_http_rpc_methods() {
|
||||
if descriptor.coverage_release() != ksp_onchain_transport_lib::HttpRpcCoverageRelease::V0_2_4 {
|
||||
continue;
|
||||
}
|
||||
assert_eq!(descriptor.operation_kind(), ksp_onchain_transport_lib::RpcOperationKind::Read);
|
||||
assert_eq!(descriptor.transport_retry_class(), ksp_onchain_transport_lib::TransportRetryClass::RetrySafe);
|
||||
match descriptor.category() {
|
||||
ksp_onchain_transport_lib::HttpRpcCategory::Blocks => actual_blocks.push(descriptor.method()),
|
||||
ksp_onchain_transport_lib::HttpRpcCategory::Economics => actual_economics.push(descriptor.method()),
|
||||
_ => {},
|
||||
}
|
||||
}
|
||||
actual_blocks.sort_unstable();
|
||||
actual_economics.sort_unstable();
|
||||
expected_blocks.sort_unstable();
|
||||
expected_economics.sort_unstable();
|
||||
assert_eq!(actual_blocks, expected_blocks);
|
||||
assert_eq!(actual_economics, expected_economics);
|
||||
assert_eq!(actual_blocks.len(), 10);
|
||||
assert_eq!(actual_economics.len(), 5);
|
||||
let get_block = ksp_onchain_transport_lib::find_http_rpc_method("getBlock").expect("getBlock descriptor must exist");
|
||||
assert!(get_block.request_form_status().has_deprecated_legacy());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user