v0.2.2-pre.007-fix.002

This commit is contained in:
2026-08-18 10:04:18 +02:00
parent 05e0e96083
commit c93a833bac
7 changed files with 118 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-onchain-transport-lib/tests/transport_devnet_smoke.rs
// version: 2
// version: 3
//! Opt-in live Devnet smoke for the pure Transport Accounts/Tokens/Cluster path.
@@ -59,16 +59,25 @@ async fn programmatic_devnet_transport_reaches_accounts_tokens_and_cluster_wrapp
assert!(account.context().slot() > 0);
assert!(account.value().is_some());
// Use the stable SPL Token program selector with a valid owner that need not own any token account.
// The smoke therefore validates the Token RPC path without depending on one mutable Devnet mint/account fixture.
// Follow the current official Devnet example shape with an ordinary owner, the canonical SPL Token program selector,
// and an explicit finalized/jsonParsed config. The owner need not retain any token account; an empty list remains valid.
let token_owner = "A1TMhSGzQxMr1TboBKtgixKz1sS6REASMxPo1qsyTSJd"
.parse::<ksp_core_lib::Pubkey>()
.expect("official Devnet token-owner example must remain a valid Pubkey literal");
let token_program = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
.parse::<ksp_core_lib::Pubkey>()
.expect("canonical SPL Token program id must remain a valid Pubkey literal");
let token_selector = ksp_onchain_transport_lib::SolanaTokenAccountSelector::ProgramId(token_program);
let token_config = ksp_onchain_transport_lib::SolanaAccountInfoConfig::new(
std::option::Option::Some(ksp_onchain_transport_lib::SolanaAccountEncoding::JsonParsed),
std::option::Option::None,
std::option::Option::Some(ksp_onchain_transport_lib::SolanaCommitment::Finalized),
std::option::Option::None,
);
let token_accounts = pool
.get_token_accounts_by_owner(&role, &ksp_core_lib::PRGIDPK_SOLANA_SYSTEM, &token_selector, std::option::Option::None)
.get_token_accounts_by_owner(&role, &token_owner, &token_selector, std::option::Option::Some(&token_config))
.await
.expect("Devnet getTokenAccountsByOwner smoke must succeed with the canonical SPL Token program selector");
.expect("Devnet getTokenAccountsByOwner smoke must succeed with the documented finalized/jsonParsed request shape");
assert!(token_accounts.context().slot() > 0);
let epoch = pool