v0.3.5-pre.004

This commit is contained in:
2026-08-31 11:14:44 +02:00
parent 7d490eb5d8
commit 45601ce386
6 changed files with 288 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-interface-lib/tests/release_completeness.rs
// version: 4
// version: 5
//! Release-completeness canaries for the public `ksp-interface-lib` surface.
@@ -9,15 +9,11 @@ fn crate_root_source() -> std::result::Result<std::string::String, std::io::Erro
}
#[test]
fn v0_3_5_pre_003_foundation_keeps_one_error_code_and_two_passive_acquisition_families() {
fn v0_3_5_pre_004_foundation_keeps_exactly_two_passive_acquisition_families() {
assert_eq!(ksp_interface_lib::ERROR_CODE_PROGRAM_INSTRUCTION_LIMIT_EXCEEDED.domain(), "interface");
assert_eq!(ksp_interface_lib::ERROR_CODE_PROGRAM_INSTRUCTION_LIMIT_EXCEEDED.code(), "program_instruction_limit_exceeded");
assert_eq!(ksp_interface_lib::MAX_PROGRAM_INSTRUCTION_ACCOUNTS, 255);
assert_eq!(ksp_interface_lib::MAX_PROGRAM_INSTRUCTION_DATA_LEN, 10_240);
let program_id = ksp_interface_lib::Pubkey::new_from_array([0xB1_u8; 32]);
let account = ksp_interface_lib::ProgramAccountMeta::readonly(ksp_interface_lib::Pubkey::new_from_array([0xB2_u8; 32]), false);
let instruction_result = ksp_interface_lib::ProgramInstruction::try_new(program_id, std::vec![account], std::vec![0xB3_u8]);
assert!(instruction_result.is_ok());
let lifecycle = ksp_interface_lib::SlotLifecycleEvent::new(u64::MAX, ksp_interface_lib::SlotLifecycleStage::Rooted);
assert_eq!(lifecycle.slot(), u64::MAX);
assert_eq!(lifecycle.stage(), ksp_interface_lib::SlotLifecycleStage::Rooted);
@@ -26,10 +22,11 @@ fn v0_3_5_pre_003_foundation_keeps_one_error_code_and_two_passive_acquisition_fa
assert_eq!(execution.slot(), u64::MAX);
assert_eq!(execution.signature(), signature);
assert_eq!(execution.outcome(), ksp_interface_lib::TransactionExecutionOutcome::Succeeded);
return;
}
#[test]
fn v0_3_5_pre_003_exact_crate_root_export_inventory_includes_both_acquisition_families() -> std::result::Result<(), std::io::Error> {
fn v0_3_5_pre_004_exact_crate_root_export_inventory_is_stable() -> std::result::Result<(), std::io::Error> {
let source = match crate_root_source() {
Ok(source) => source,
Err(error) => return Err(error),
@@ -51,7 +48,7 @@ fn v0_3_5_pre_003_exact_crate_root_export_inventory_includes_both_acquisition_fa
}
#[test]
fn v0_3_5_pre_003_production_module_inventory_adds_only_transaction_execution() -> std::result::Result<(), std::io::Error> {
fn v0_3_5_pre_004_production_module_inventory_is_exact() -> std::result::Result<(), std::io::Error> {
let source = match crate_root_source() {
Ok(source) => source,
Err(error) => return Err(error),
@@ -67,3 +64,12 @@ fn v0_3_5_pre_003_production_module_inventory_adds_only_transaction_execution()
assert!(!source.contains("ksp_store"));
return Ok(());
}
#[test]
fn v0_3_5_pre_004_evolutive_acquisition_enums_remain_non_exhaustive() {
let lifecycle_source = include_str!("../src/slot_lifecycle.rs");
let execution_source = include_str!("../src/transaction_execution.rs");
assert!(lifecycle_source.contains("#[non_exhaustive]\npub enum SlotLifecycleStage"));
assert!(execution_source.contains("#[non_exhaustive]\npub enum TransactionExecutionOutcome"));
return;
}