v0.1.0-pre.062
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// file: kb-pipeline-demo-scenarios/src/solana_token_execution.rs
|
||||
// version: 7
|
||||
// version: 9
|
||||
|
||||
//! Devnet classic SPL Token execution with stateful and canonical post-validation.
|
||||
|
||||
@@ -372,7 +372,7 @@ where
|
||||
};
|
||||
summary.materializations = rows
|
||||
.into_iter()
|
||||
.filter(|row| return row.source_decoder_name == "spl_token")
|
||||
.filter(|row| return row.source_decoder_name == "spl.token")
|
||||
.collect();
|
||||
diagnostic.materialized =
|
||||
!summary.plan.policy.post_execution_validation.materialization_required
|
||||
@@ -973,18 +973,16 @@ pub(crate) fn decode_completed(summary: &kb_pipeline::DecodeReplaySummary) -> bo
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
fn local_devnet_profile() -> kb_config::ProfileConfig {
|
||||
fn example_devnet_profile() -> kb_config::ProfileConfig {
|
||||
let config =
|
||||
match kb_config::parse_config_json(include_str!("../../config/example.config.json")) {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => panic!("example config parse failed: {error}"),
|
||||
};
|
||||
for profile in config.profiles {
|
||||
if profile.name == "local_devnet" {
|
||||
return profile;
|
||||
}
|
||||
}
|
||||
panic!("local_devnet profile missing");
|
||||
return match crate::resolve_demo_devnet_profile(&config, std::option::Option::None) {
|
||||
std::result::Result::Ok(profile) => profile,
|
||||
std::result::Result::Err(error) => panic!("Devnet profile resolution failed: {error}"),
|
||||
};
|
||||
}
|
||||
|
||||
fn checked_transfer(fee_authority: &str) -> kb_lib::ExSplClassicTokenOperation {
|
||||
@@ -1018,7 +1016,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn checked_transfer_plan_is_simulation_first_and_authorizes_exact_signers() {
|
||||
let profile = local_devnet_profile();
|
||||
let profile = example_devnet_profile();
|
||||
let fee_payer = kb_lib::MdPubkey(kb_program_ids::SYSTEM_PROGRAM_ID.to_string());
|
||||
let authority = kb_program_ids::VOTE_PROGRAM_ID;
|
||||
let request =
|
||||
@@ -1036,7 +1034,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn conversion_plan_does_not_invent_materialization_requirement() {
|
||||
let profile = local_devnet_profile();
|
||||
let profile = example_devnet_profile();
|
||||
let request = crate::DevnetSplTokenExecutionRequest::new(
|
||||
"token-3",
|
||||
kb_lib::ExSplClassicTokenOperation::Instruction {
|
||||
@@ -1092,7 +1090,7 @@ mod tests {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(_) => "1".to_string(),
|
||||
};
|
||||
let mut profile = local_devnet_profile();
|
||||
let mut profile = example_devnet_profile();
|
||||
if let std::result::Result::Ok(directory) = std::env::var("KB_DEVNET_WALLET_DIR") {
|
||||
profile.wallet.wallet_dir = directory;
|
||||
}
|
||||
@@ -1262,7 +1260,7 @@ mod tests {
|
||||
},
|
||||
std::result::Result::Err(_) => 9,
|
||||
};
|
||||
let mut profile = local_devnet_profile();
|
||||
let mut profile = example_devnet_profile();
|
||||
if let std::result::Result::Ok(directory) = std::env::var("KB_DEVNET_WALLET_DIR") {
|
||||
profile.wallet.wallet_dir = directory;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user