v0.2.13-pre.003
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// file: crates/ksp-interface-lib/tests/dependency_boundary.rs
|
||||
// version: 1
|
||||
// version: 2
|
||||
|
||||
//! Dependency and passive-surface canaries for the Interface scaffold.
|
||||
//! Dependency and passive-surface canaries for the Interface foundation.
|
||||
|
||||
#[test]
|
||||
fn pre_002_manifest_has_exact_core_only_runtime_dependency() {
|
||||
@@ -45,10 +45,11 @@ fn pre_002_manifest_has_exact_core_only_runtime_dependency() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pre_002_scaffold_remains_passive_without_runtime_logging_surface() {
|
||||
fn pre_003_surface_remains_passive_without_instruction_or_runtime_logging() {
|
||||
let crate_root = include_str!("../src/lib.rs");
|
||||
assert!(crate_root.contains("pub use ksp_core_lib::Pubkey;"));
|
||||
assert!(!crate_root.contains("ProgramAccountMeta"));
|
||||
assert!(crate_root.contains("ProgramAccountMeta"));
|
||||
assert!(crate_root.contains("MAX_PROGRAM_INSTRUCTION_ACCOUNTS"));
|
||||
assert!(crate_root.contains("ERROR_CODE_PROGRAM_INSTRUCTION_LIMIT_EXCEEDED"));
|
||||
assert!(!crate_root.contains("ProgramInstruction"));
|
||||
assert!(!crate_root.contains("TRACING_TARGET"));
|
||||
assert!(!crate_root.contains("ksp_logging_lib"));
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// file: crates/ksp-interface-lib/tests/public_api.rs
|
||||
// version: 1
|
||||
// version: 2
|
||||
|
||||
//! Integration canaries for the public `ksp-interface-lib` scaffold.
|
||||
//! Integration canaries for the public `ksp-interface-lib` foundation.
|
||||
|
||||
fn consume_pubkey(pubkey: ksp_interface_lib::Pubkey) -> [u8; 32] {
|
||||
return pubkey.to_bytes();
|
||||
@@ -13,3 +13,26 @@ fn public_pre_002_pubkey_contract_is_available_from_crate_root() {
|
||||
assert_eq!(consume_pubkey(pubkey), [0_u8; 32]);
|
||||
return;
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn public_pre_003_account_meta_and_limit_contracts_are_available_from_crate_root() {
|
||||
let pubkey = ksp_interface_lib::Pubkey::new_from_array([3_u8; 32]);
|
||||
let readonly = ksp_interface_lib::ProgramAccountMeta::readonly(pubkey, true);
|
||||
let writable = ksp_interface_lib::ProgramAccountMeta::writable(pubkey, false);
|
||||
assert_eq!(readonly.pubkey(), &pubkey);
|
||||
assert!(readonly.is_signer());
|
||||
assert!(!readonly.is_writable());
|
||||
assert_eq!(writable.pubkey(), &pubkey);
|
||||
assert!(!writable.is_signer());
|
||||
assert!(writable.is_writable());
|
||||
assert_eq!(ksp_interface_lib::MAX_PROGRAM_INSTRUCTION_ACCOUNTS, 255);
|
||||
return;
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn public_pre_003_interface_error_code_is_stable_and_core_owned() {
|
||||
let code: ksp_core_lib::ErrorCode = ksp_interface_lib::ERROR_CODE_PROGRAM_INSTRUCTION_LIMIT_EXCEEDED;
|
||||
assert_eq!(code.domain(), "interface");
|
||||
assert_eq!(code.code(), "program_instruction_limit_exceeded");
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user