v0.5.3-pre.002
This commit is contained in:
@@ -1,8 +1,14 @@
|
||||
<!-- file: ks-pipeline-demo-scenarios/CHANGELOG.md -->
|
||||
<!-- version: 81 -->
|
||||
<!-- version: 82 -->
|
||||
|
||||
# CHANGELOG — ks-pipeline-demo-scenarios
|
||||
|
||||
## `0.5.3-pre.002`
|
||||
|
||||
- remplace les constructions `PostgresStore`/`PostgresStoreOptions` des scénarios par `ks_store::Store` et `StoreOpenOptions` ;
|
||||
- conserve les overrides PostgreSQL des tests opt-in sous forme de modification du bloc opaque `backend_options`, sans exposer de type backend dans les signatures de scénarios ;
|
||||
- adapte les campagnes Solana/SPL/Metadata afin qu'elles réutilisent la même façade de store que `ks-pipeline` et le desktop.
|
||||
|
||||
## `0.5.2-pre.006-delta-fix-006`
|
||||
|
||||
- corrige le wrapper pNFT legacy : il reprend son paramètre `workspace_root` historique et construit le wallet temporaire uniquement dans ce wrapper, tandis que la variante `_with_wallet` conserve le signer explicite ;
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
<!-- file: ks-pipeline-demo-scenarios/README.md -->
|
||||
<!-- version: 31 -->
|
||||
<!-- version: 32 -->
|
||||
|
||||
# ks-pipeline-demo-scenarios
|
||||
|
||||
`ks-pipeline-demo-scenarios` fournit des scénarios synthétiques et des campagnes Devnet/Testnet automatisables au-dessus de `ks-pipeline`.
|
||||
|
||||
La crate ouvre désormais le stockage de ses profils via la façade backend-agnostique `ks_store::Store`. Elle ne construit ni `PostgresStore`, ni pool SQLx ; les paramètres du moteur restent interprétés par `ks-store`.
|
||||
|
||||
La crate contient :
|
||||
|
||||
- la bibliothèque Rust `ks_pipeline_demo_scenarios` ;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!-- file: ks-pipeline-demo-scenarios/USAGE.md -->
|
||||
<!-- version: 33 -->
|
||||
<!-- version: 34 -->
|
||||
|
||||
# Utilisation de ks-pipeline-demo-scenarios
|
||||
|
||||
@@ -21,7 +21,7 @@ fn initialize_environment() -> ks_core::Result<()> {
|
||||
}
|
||||
```
|
||||
|
||||
`resolve_demo_devnet_profile` sélectionne un profil Devnet configuré et `prepare_demo_devnet_profile_store` vérifie ou initialise son stockage PostgreSQL.
|
||||
`resolve_demo_devnet_profile` sélectionne un profil Devnet configuré et `prepare_demo_devnet_profile_store` ouvre/vérifie son `ks_store::Store`. Le scénario ne connaît pas le backend concret ; PostgreSQL reste actuellement sélectionné par la configuration mais sa connexion appartient à `ks-store`.
|
||||
|
||||
## Observer une exécution
|
||||
|
||||
@@ -63,13 +63,12 @@ fn memo_request() -> ks_pipeline_demo_scenarios::DevnetMemoExecutionRequest {
|
||||
```
|
||||
|
||||
```rust
|
||||
async fn run_memo<S, O>(
|
||||
store: &S,
|
||||
async fn run_memo<O>(
|
||||
store: &ks_store::Store,
|
||||
observer: &O,
|
||||
request: ks_pipeline_demo_scenarios::DevnetMemoExecutionRequest,
|
||||
) -> ks_core::Result<ks_pipeline_demo_scenarios::DevnetMemoExecutionSummary>
|
||||
where
|
||||
S: ks_store::Store + Sync,
|
||||
O: ks_pipeline_demo_scenarios::SolanaExecutionObserver,
|
||||
{
|
||||
let result = ks_pipeline_demo_scenarios::execute_devnet_memo(
|
||||
@@ -78,14 +77,12 @@ where
|
||||
request,
|
||||
)
|
||||
.await;
|
||||
|
||||
match result {
|
||||
Ok(summary) => Ok(summary),
|
||||
Err(error) => Err(error),
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Simuler Token-2022
|
||||
|
||||
```rust
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: ks-pipeline-demo-scenarios/src/environment.rs
|
||||
// version: 7
|
||||
// version: 9
|
||||
|
||||
//! Environment initialization for opt-in demonstration scenarios.
|
||||
|
||||
@@ -83,28 +83,53 @@ pub fn resolve_demo_devnet_profile(
|
||||
};
|
||||
}
|
||||
|
||||
/// Readiness report for one Devnet profile PostgreSQL store.
|
||||
/// Backend-agnostic readiness report for one Devnet profile store.
|
||||
#[derive(Clone, Debug, serde::Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct DevnetProfileStoreReadiness {
|
||||
/// Selected Devnet profile.
|
||||
pub profile_name: std::string::String,
|
||||
/// Selected backend code.
|
||||
pub backend: std::string::String,
|
||||
/// Whether schema creation was allowed by configuration.
|
||||
pub auto_initialize_schema: bool,
|
||||
/// Number of known tables already present before preparation.
|
||||
pub existing_tables_before: usize,
|
||||
/// Number of known tables created during preparation.
|
||||
pub created_tables: usize,
|
||||
/// Number of known tables present after preparation.
|
||||
pub existing_tables_after: usize,
|
||||
/// Total number of known tables expected by the current store.
|
||||
pub expected_tables: usize,
|
||||
/// Number of known logical resources already present before preparation.
|
||||
pub available_resources_before: usize,
|
||||
/// Number of known logical resources created during preparation.
|
||||
pub created_resources: usize,
|
||||
/// Number of known logical resources present after preparation.
|
||||
pub available_resources_after: usize,
|
||||
/// Total number of logical resources expected by the current store contract.
|
||||
pub expected_resources: usize,
|
||||
}
|
||||
|
||||
/// Verifies or initializes the PostgreSQL schema selected by one Devnet profile.
|
||||
/// Builds backend-agnostic store-open options from one resolved profile.
|
||||
fn store_open_options_from_profile(
|
||||
profile: &ks_config::ProfileConfig,
|
||||
) -> ks_core::Result<ks_store::StoreOpenOptions> {
|
||||
return ks_store::StoreOpenOptions::new(
|
||||
profile.database.enabled,
|
||||
profile.database.backend.clone(),
|
||||
profile.database.backend_options.clone(),
|
||||
);
|
||||
}
|
||||
|
||||
/// Opens the backend-agnostic store selected by one resolved profile.
|
||||
#[cfg(test)]
|
||||
pub(crate) async fn open_profile_store(
|
||||
profile: &ks_config::ProfileConfig,
|
||||
) -> ks_core::Result<ks_store::Store> {
|
||||
let options = match store_open_options_from_profile(profile) {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => return std::result::Result::Err(error),
|
||||
};
|
||||
return ks_store::Store::open(options).await;
|
||||
}
|
||||
|
||||
/// Verifies or initializes the store selected by one Devnet profile.
|
||||
pub async fn prepare_demo_devnet_profile_store(
|
||||
profile: &ks_config::ProfileConfig,
|
||||
) -> ks_core::Result<DevnetProfileStoreReadiness> {
|
||||
) -> ks_core::Result<crate::DevnetProfileStoreReadiness> {
|
||||
if profile.wallet.cluster != "devnet" {
|
||||
return std::result::Result::Err(ks_core::Error::config(format!(
|
||||
"profile '{}' is not configured for Devnet",
|
||||
@@ -117,65 +142,78 @@ pub async fn prepare_demo_devnet_profile_store(
|
||||
profile.name
|
||||
)));
|
||||
}
|
||||
if profile.database.backend != "postgres" {
|
||||
let options = match store_open_options_from_profile(profile) {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => return std::result::Result::Err(error),
|
||||
};
|
||||
let configuration = match options.configuration_summary() {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => return std::result::Result::Err(error),
|
||||
};
|
||||
let store = match ks_store::Store::open(options).await {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => return std::result::Result::Err(error),
|
||||
};
|
||||
let initialization = store.initialization_summary();
|
||||
if initialization.status != ks_store::StoreInitializationStatus::Ready {
|
||||
return std::result::Result::Err(ks_core::Error::config(format!(
|
||||
"Devnet profile '{}' must use the PostgreSQL backend",
|
||||
profile.name
|
||||
"Devnet profile '{}' store model is incomplete and automatic initialization is {}",
|
||||
profile.name,
|
||||
if configuration.auto_initialize_schema { "enabled" } else { "disabled" }
|
||||
)));
|
||||
}
|
||||
let options = match ks_store::PostgresStoreOptions::new(
|
||||
profile.database.postgres.url.clone(),
|
||||
profile.database.postgres.max_connections,
|
||||
profile.database.postgres.connect_timeout_ms,
|
||||
false,
|
||||
return std::result::Result::Ok(crate::DevnetProfileStoreReadiness {
|
||||
profile_name: profile.name.clone(),
|
||||
backend: configuration.backend_code,
|
||||
auto_initialize_schema: configuration.auto_initialize_schema,
|
||||
available_resources_before: initialization
|
||||
.available_resource_count
|
||||
.saturating_sub(initialization.created_resource_count)
|
||||
as usize,
|
||||
created_resources: initialization.created_resource_count as usize,
|
||||
available_resources_after: initialization.available_resource_count as usize,
|
||||
expected_resources: initialization.expected_resource_count as usize,
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) fn override_profile_store_url_for_test(
|
||||
profile: &mut ks_config::ProfileConfig,
|
||||
database_url: std::string::String,
|
||||
) -> ks_core::Result<()> {
|
||||
profile.database.enabled = true;
|
||||
profile.database.backend = "postgres".to_string();
|
||||
let backend_options = match profile.database.backend_options.as_object_mut() {
|
||||
std::option::Option::Some(value) => value,
|
||||
std::option::Option::None => {
|
||||
return std::result::Result::Err(ks_core::Error::config(
|
||||
"test store backend options must be an object",
|
||||
));
|
||||
},
|
||||
};
|
||||
backend_options.insert("url".to_string(), serde_json::Value::String(database_url));
|
||||
backend_options.insert("auto_initialize_schema".to_string(), serde_json::Value::Bool(true));
|
||||
return std::result::Result::Ok(());
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) async fn open_test_store(
|
||||
database_url: std::string::String,
|
||||
) -> ks_core::Result<ks_store::Store> {
|
||||
let options = match ks_store::StoreOpenOptions::new(
|
||||
true,
|
||||
"postgres",
|
||||
serde_json::json!({
|
||||
"url": database_url,
|
||||
"max_connections": 5,
|
||||
"connect_timeout_ms": 5_000,
|
||||
"auto_initialize_schema": true
|
||||
}),
|
||||
) {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => return std::result::Result::Err(error),
|
||||
};
|
||||
let store = match ks_store::PostgresStore::connect(options).await {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => return std::result::Result::Err(error),
|
||||
};
|
||||
let before = match store.known_table_diagnostics().await {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => return std::result::Result::Err(error),
|
||||
};
|
||||
let existing_tables_before = before.iter().filter(|table| return table.exists).count();
|
||||
if profile.database.postgres.auto_initialize_schema
|
||||
&& let std::result::Result::Err(error) = store.initialize_store_schema().await
|
||||
{
|
||||
return std::result::Result::Err(error);
|
||||
}
|
||||
let after = match store.known_table_diagnostics().await {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => return std::result::Result::Err(error),
|
||||
};
|
||||
let existing_tables_after = after.iter().filter(|table| return table.exists).count();
|
||||
if existing_tables_after != after.len() {
|
||||
let missing = after
|
||||
.iter()
|
||||
.filter(|table| return !table.exists)
|
||||
.map(|table| return table.table_name.clone())
|
||||
.collect::<std::vec::Vec<_>>();
|
||||
return std::result::Result::Err(ks_core::Error::config(format!(
|
||||
"Devnet profile '{}' PostgreSQL schema is incomplete and auto initialization is {}: missing {}",
|
||||
profile.name,
|
||||
if profile.database.postgres.auto_initialize_schema {
|
||||
"enabled"
|
||||
} else {
|
||||
"disabled"
|
||||
},
|
||||
missing.join(", ")
|
||||
)));
|
||||
}
|
||||
return std::result::Result::Ok(DevnetProfileStoreReadiness {
|
||||
profile_name: profile.name.clone(),
|
||||
auto_initialize_schema: profile.database.postgres.auto_initialize_schema,
|
||||
existing_tables_before,
|
||||
created_tables: existing_tables_after.saturating_sub(existing_tables_before),
|
||||
existing_tables_after,
|
||||
expected_tables: after.len(),
|
||||
});
|
||||
return ks_store::Store::open(options).await;
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: ks-pipeline-demo-scenarios/src/lib.rs
|
||||
// version: 31
|
||||
// version: 34
|
||||
|
||||
#![forbid(unsafe_code)]
|
||||
#![deny(unreachable_pub)]
|
||||
@@ -14,17 +14,27 @@ mod solana;
|
||||
mod spl;
|
||||
mod wallet;
|
||||
|
||||
/// Readiness report for one Devnet profile PostgreSQL store.
|
||||
/// Backend-agnostic readiness report for one Devnet profile store.
|
||||
pub use self::environment::DevnetProfileStoreReadiness;
|
||||
/// Loads the workspace environment for opt-in demo and Devnet scenarios.
|
||||
pub use self::environment::initialize_demo_scenario_environment;
|
||||
/// Loads the shared default configuration or an explicit scenario composition override.
|
||||
pub use self::environment::load_demo_scenario_config;
|
||||
/// Verifies or initializes the PostgreSQL schema selected by one Devnet profile.
|
||||
/// Verifies or initializes the store selected by one Devnet profile.
|
||||
pub use self::environment::prepare_demo_devnet_profile_store;
|
||||
/// Resolves one configured Devnet profile for UI, CLI and test scenarios.
|
||||
pub use self::environment::resolve_demo_devnet_profile;
|
||||
/// Complete evidence produced by one collection parent/member verification campaign.
|
||||
|
||||
#[cfg(test)]
|
||||
/// Opens one backend-agnostic store for internal scenarios.
|
||||
pub(crate) use self::environment::open_profile_store;
|
||||
#[cfg(test)]
|
||||
/// Opens one backend-agnostic store from a direct test URL.
|
||||
pub(crate) use self::environment::open_test_store;
|
||||
#[cfg(test)]
|
||||
/// Overrides one profile store URL for PostgreSQL integration tests without exposing backend types.
|
||||
pub(crate) use self::environment::override_profile_store_url_for_test;
|
||||
/// Complete evidence retained by one Metaplex collection verification campaign.
|
||||
pub use self::metadata::metaplex_token_metadata::collection_verify_campaign::DevnetMetaplexCollectionVerifyCampaignSummary;
|
||||
/// Collection relation and sized-collection state observed across verification.
|
||||
pub use self::metadata::metaplex_token_metadata::collection_verify_campaign::DevnetMetaplexCollectionVerifyState;
|
||||
@@ -88,7 +98,7 @@ pub(crate) use self::metadata::metaplex_token_metadata::fixture::classic_fixture
|
||||
pub(crate) use self::metadata::metaplex_token_metadata::fixture::classic_fixture_token_account_state;
|
||||
/// Reads the validated classic SPL token-account amount for an internal Metaplex campaign.
|
||||
pub(crate) use self::metadata::metaplex_token_metadata::fixture::classic_fixture_token_amount;
|
||||
/// Creates or reuses a classic SPL mint and derives its Metaplex PDAs.
|
||||
/// Creates the default classic SPL fixture required by one Metaplex Create campaign.
|
||||
pub use self::metadata::metaplex_token_metadata::fixture::prepare_metaplex_create_fixture;
|
||||
/// Creates a classic SPL mint fixture using an explicitly resolved operator wallet.
|
||||
pub use self::metadata::metaplex_token_metadata::fixture::prepare_metaplex_create_fixture_with_wallet;
|
||||
@@ -100,7 +110,7 @@ pub(crate) use self::metadata::metaplex_token_metadata::fixture::read_token_acco
|
||||
pub(crate) use self::metadata::metaplex_token_metadata::fixture::validate_classic_fixture_mint_state;
|
||||
/// Validates one classic SPL token-account fixture against an exact expected amount.
|
||||
pub(crate) use self::metadata::metaplex_token_metadata::fixture::validate_classic_fixture_token_account_state;
|
||||
/// Complete evidence produced by the final Metaplex maintenance campaign.
|
||||
/// Complete evidence retained by one bounded Metaplex maintenance campaign.
|
||||
pub use self::metadata::metaplex_token_metadata::maintenance_campaign::DevnetMetaplexMaintenanceCampaignSummary;
|
||||
/// Executes the final bounded current maintenance campaign on Devnet.
|
||||
pub use self::metadata::metaplex_token_metadata::maintenance_campaign::execute_devnet_metaplex_maintenance_campaign;
|
||||
@@ -256,7 +266,7 @@ pub use self::solana::SolanaExecutionObserver;
|
||||
pub use self::solana::SolanaExecutionProgressEvent;
|
||||
/// Severity of one Solana execution progress event.
|
||||
pub use self::solana::SolanaExecutionProgressLevel;
|
||||
/// Emits one execution progress event for specialized pipeline orchestrators.
|
||||
/// Emits one execution progress event through the optional internal observer.
|
||||
pub(crate) use self::solana::emit;
|
||||
/// Rejects one execution stage when the observer reports cancellation.
|
||||
pub(crate) use self::solana::ensure_not_cancelled;
|
||||
@@ -266,7 +276,7 @@ pub use self::solana::execute_devnet_system_transfer;
|
||||
pub use self::solana::execute_devnet_system_transfer_with_wallet;
|
||||
/// Inspects the persistent native wallet alias selected by one execution profile.
|
||||
pub use self::solana::inspect_selected_profile_wallet;
|
||||
/// Loads the managed temporary wallet used by legacy Devnet scenarios.
|
||||
/// Loads the temporary wallet fixture selected by one execution profile.
|
||||
pub(crate) use self::solana::load_profile_temporary_wallet;
|
||||
/// Formats one failed simulation without discarding runtime diagnostics.
|
||||
pub(crate) use self::solana::simulation_failure_message;
|
||||
@@ -296,7 +306,7 @@ pub use self::spl::memo::execute_devnet_memo_with_wallet;
|
||||
pub use self::spl::token::execution::DevnetSplTokenExecutionRequest;
|
||||
/// Complete result of one Devnet classic SPL Token execution.
|
||||
pub use self::spl::token::execution::DevnetSplTokenExecutionSummary;
|
||||
/// Canonical hydration availability helper shared by Token lifecycle orchestration.
|
||||
/// Reports whether canonical transaction data is available for one signature.
|
||||
pub(crate) use self::spl::token::execution::canonical_available;
|
||||
/// Decode completion helper shared by Token lifecycle orchestration.
|
||||
pub(crate) use self::spl::token::execution::decode_completed;
|
||||
@@ -304,7 +314,7 @@ pub(crate) use self::spl::token::execution::decode_completed;
|
||||
pub use self::spl::token::execution::execute_devnet_spl_token;
|
||||
/// Executes one SPL Token operation with an explicitly resolved wallet capability.
|
||||
pub use self::spl::token::execution::execute_devnet_spl_token_with_wallet;
|
||||
/// Canonical signature hydration helper shared by Token lifecycle orchestration.
|
||||
/// Hydrates one submitted signature into the canonical raw/Core pipeline.
|
||||
pub(crate) use self::spl::token::execution::hydrate_signature;
|
||||
/// Targeted program replay helper shared by Token lifecycle orchestration.
|
||||
pub(crate) use self::spl::token::execution::replay_program;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: ks-pipeline-demo-scenarios/src/metadata/metaplex_token_metadata/collection_verify_campaign.rs
|
||||
// version: 7
|
||||
// version: 9
|
||||
|
||||
//! Confirmed Devnet collection parent/member `Verify -> Unverify` campaign.
|
||||
|
||||
@@ -678,23 +678,14 @@ mod tests {
|
||||
.unwrap_or_else(|error| panic!("Devnet profile resolution failed: {error}"));
|
||||
let database_url = std::env::var("KS_SECRET_POSTGRES_TEST_URL")
|
||||
.unwrap_or_else(|error| panic!("KS_SECRET_POSTGRES_TEST_URL is required: {error}"));
|
||||
profile.database.backend = "postgres".to_string();
|
||||
profile.database.postgres.url = database_url;
|
||||
crate::override_profile_store_url_for_test(&mut profile, database_url)
|
||||
.unwrap_or_else(|error| panic!("Store test override failed: {error}"));
|
||||
let pool = ks_onchain_transport::HttpEndpointPool::from_profile(&profile)
|
||||
.unwrap_or_else(|error| panic!("HTTP pool creation failed: {error}"));
|
||||
let store_options = ks_store::PostgresStoreOptions::new(
|
||||
profile.database.postgres.url.clone(),
|
||||
profile.database.postgres.max_connections,
|
||||
profile.database.postgres.connect_timeout_ms,
|
||||
false,
|
||||
)
|
||||
.unwrap_or_else(|error| panic!("PostgreSQL options failed: {error}"));
|
||||
let store = ks_store::PostgresStore::connect(store_options)
|
||||
.await
|
||||
.unwrap_or_else(|error| panic!("PostgreSQL connection failed: {error}"));
|
||||
if let std::result::Result::Err(error) = store.initialize_store_schema().await {
|
||||
panic!("PostgreSQL schema initialization failed: {error}");
|
||||
}
|
||||
let store = match crate::open_profile_store(&profile).await {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => panic!("Store connection failed: {error}"),
|
||||
};
|
||||
let configured_wallet_dir =
|
||||
std::path::PathBuf::from(profile.wallet.temporary_wallet_dir.as_str());
|
||||
let wallet_dir = if configured_wallet_dir.is_absolute() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: ks-pipeline-demo-scenarios/src/metadata/metaplex_token_metadata/create_mint_campaign.rs
|
||||
// version: 15
|
||||
// version: 17
|
||||
|
||||
//! Confirmed Devnet `Create -> Mint` campaign for one Metaplex asset family.
|
||||
|
||||
@@ -844,23 +844,14 @@ mod tests {
|
||||
.unwrap_or_else(|error| panic!("Devnet profile resolution failed: {error}"));
|
||||
let database_url = std::env::var("KS_SECRET_POSTGRES_TEST_URL")
|
||||
.unwrap_or_else(|error| panic!("KS_SECRET_POSTGRES_TEST_URL is required: {error}"));
|
||||
profile.database.backend = "postgres".to_string();
|
||||
profile.database.postgres.url = database_url;
|
||||
crate::override_profile_store_url_for_test(&mut profile, database_url)
|
||||
.unwrap_or_else(|error| panic!("Store test override failed: {error}"));
|
||||
let pool = ks_onchain_transport::HttpEndpointPool::from_profile(&profile)
|
||||
.unwrap_or_else(|error| panic!("HTTP pool creation failed: {error}"));
|
||||
let store_options = ks_store::PostgresStoreOptions::new(
|
||||
profile.database.postgres.url.clone(),
|
||||
profile.database.postgres.max_connections,
|
||||
profile.database.postgres.connect_timeout_ms,
|
||||
false,
|
||||
)
|
||||
.unwrap_or_else(|error| panic!("PostgreSQL options failed: {error}"));
|
||||
let store = ks_store::PostgresStore::connect(store_options)
|
||||
.await
|
||||
.unwrap_or_else(|error| panic!("PostgreSQL connection failed: {error}"));
|
||||
if let std::result::Result::Err(error) = store.initialize_store_schema().await {
|
||||
panic!("PostgreSQL schema initialization failed: {error}");
|
||||
}
|
||||
let store = match crate::open_profile_store(&profile).await {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => panic!("Store connection failed: {error}"),
|
||||
};
|
||||
let configured_wallet_dir =
|
||||
std::path::PathBuf::from(profile.wallet.temporary_wallet_dir.as_str());
|
||||
let wallet_dir = if configured_wallet_dir.is_absolute() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: ks-pipeline-demo-scenarios/src/metadata/metaplex_token_metadata/devnet_execution.rs
|
||||
// version: 24
|
||||
// version: 26
|
||||
|
||||
//! Real Devnet simulation and submission for current Metaplex Token Metadata operations.
|
||||
|
||||
@@ -1516,18 +1516,10 @@ mod tests {
|
||||
panic!("KS_SECRET_POSTGRES_TEST_URL is required for Metaplex execution: {error}")
|
||||
},
|
||||
};
|
||||
let store_options = match ks_store::PostgresStoreOptions::new(database_url, 5, 5_000, false)
|
||||
{
|
||||
let store = match crate::open_test_store(database_url).await {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => panic!("Postgres options failed: {error}"),
|
||||
std::result::Result::Err(error) => panic!("Store connection failed: {error}"),
|
||||
};
|
||||
let store = match ks_store::PostgresStore::connect(store_options).await {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => panic!("Postgres connection failed: {error}"),
|
||||
};
|
||||
if let std::result::Result::Err(error) = store.initialize_store_schema().await {
|
||||
panic!("Postgres schema initialization failed: {error}");
|
||||
}
|
||||
let workspace_root = match std::path::Path::new(env!("CARGO_MANIFEST_DIR")).parent() {
|
||||
std::option::Option::Some(value) => value,
|
||||
std::option::Option::None => panic!("workspace root cannot be resolved"),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: ks-pipeline-demo-scenarios/src/metadata/metaplex_token_metadata/escrow_campaign.rs
|
||||
// version: 7
|
||||
// version: 9
|
||||
|
||||
//! Confirmed Devnet Token Owned Escrow campaign for current Metaplex escrow operations.
|
||||
|
||||
@@ -1004,23 +1004,14 @@ mod tests {
|
||||
.unwrap_or_else(|error| panic!("Devnet profile resolution failed: {error}"));
|
||||
let database_url = std::env::var("KS_SECRET_POSTGRES_TEST_URL")
|
||||
.unwrap_or_else(|error| panic!("KS_SECRET_POSTGRES_TEST_URL is required: {error}"));
|
||||
profile.database.backend = "postgres".to_string();
|
||||
profile.database.postgres.url = database_url;
|
||||
crate::override_profile_store_url_for_test(&mut profile, database_url)
|
||||
.unwrap_or_else(|error| panic!("Store test override failed: {error}"));
|
||||
let http_pool = ks_onchain_transport::HttpEndpointPool::from_profile(&profile)
|
||||
.unwrap_or_else(|error| panic!("HTTP pool initialization failed: {error}"));
|
||||
let store_options = ks_store::PostgresStoreOptions::new(
|
||||
profile.database.postgres.url.clone(),
|
||||
profile.database.postgres.max_connections,
|
||||
profile.database.postgres.connect_timeout_ms,
|
||||
false,
|
||||
)
|
||||
.unwrap_or_else(|error| panic!("PostgreSQL options failed: {error}"));
|
||||
let store = ks_store::PostgresStore::connect(store_options)
|
||||
.await
|
||||
.unwrap_or_else(|error| panic!("PostgreSQL connection failed: {error}"));
|
||||
if let std::result::Result::Err(error) = store.initialize_store_schema().await {
|
||||
panic!("PostgreSQL schema initialization failed: {error}");
|
||||
}
|
||||
let store = match crate::open_profile_store(&profile).await {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => panic!("Store connection failed: {error}"),
|
||||
};
|
||||
let configured_wallet_dir =
|
||||
std::path::PathBuf::from(profile.wallet.temporary_wallet_dir.as_str());
|
||||
let wallet_dir = if configured_wallet_dir.is_absolute() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: ks-pipeline-demo-scenarios/src/metadata/metaplex_token_metadata/maintenance_campaign.rs
|
||||
// version: 9
|
||||
// version: 11
|
||||
|
||||
//! Final bounded Devnet qualification campaign for current Metaplex maintenance operations.
|
||||
|
||||
@@ -598,23 +598,14 @@ mod tests {
|
||||
.unwrap_or_else(|error| panic!("Devnet profile resolution failed: {error}"));
|
||||
let database_url = std::env::var("KS_SECRET_POSTGRES_TEST_URL")
|
||||
.unwrap_or_else(|error| panic!("KS_SECRET_POSTGRES_TEST_URL is required: {error}"));
|
||||
profile.database.backend = "postgres".to_string();
|
||||
profile.database.postgres.url = database_url;
|
||||
crate::override_profile_store_url_for_test(&mut profile, database_url)
|
||||
.unwrap_or_else(|error| panic!("Store test override failed: {error}"));
|
||||
let http_pool = ks_onchain_transport::HttpEndpointPool::from_profile(&profile)
|
||||
.unwrap_or_else(|error| panic!("HTTP pool initialization failed: {error}"));
|
||||
let store_options = ks_store::PostgresStoreOptions::new(
|
||||
profile.database.postgres.url.clone(),
|
||||
profile.database.postgres.max_connections,
|
||||
profile.database.postgres.connect_timeout_ms,
|
||||
false,
|
||||
)
|
||||
.unwrap_or_else(|error| panic!("PostgreSQL options failed: {error}"));
|
||||
let store = ks_store::PostgresStore::connect(store_options)
|
||||
.await
|
||||
.unwrap_or_else(|error| panic!("PostgreSQL connection failed: {error}"));
|
||||
if let std::result::Result::Err(error) = store.initialize_store_schema().await {
|
||||
panic!("PostgreSQL schema initialization failed: {error}");
|
||||
}
|
||||
let store = match crate::open_profile_store(&profile).await {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => panic!("Store connection failed: {error}"),
|
||||
};
|
||||
let configured_wallet_dir =
|
||||
std::path::PathBuf::from(profile.wallet.temporary_wallet_dir.as_str());
|
||||
let wallet_dir = if configured_wallet_dir.is_absolute() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: ks-pipeline-demo-scenarios/src/metadata/metaplex_token_metadata/pnft_lifecycle_campaign.rs
|
||||
// version: 10
|
||||
// version: 12
|
||||
|
||||
//! Confirmed Devnet pNFT delegate, lock, unlock, revoke and transfer campaign.
|
||||
|
||||
@@ -1096,23 +1096,14 @@ mod tests {
|
||||
.unwrap_or_else(|error| panic!("Devnet profile resolution failed: {error}"));
|
||||
let database_url = std::env::var("KS_SECRET_POSTGRES_TEST_URL")
|
||||
.unwrap_or_else(|error| panic!("KS_SECRET_POSTGRES_TEST_URL is required: {error}"));
|
||||
profile.database.backend = "postgres".to_string();
|
||||
profile.database.postgres.url = database_url;
|
||||
crate::override_profile_store_url_for_test(&mut profile, database_url)
|
||||
.unwrap_or_else(|error| panic!("Store test override failed: {error}"));
|
||||
let http_pool = ks_onchain_transport::HttpEndpointPool::from_profile(&profile)
|
||||
.unwrap_or_else(|error| panic!("HTTP pool initialization failed: {error}"));
|
||||
let store_options = ks_store::PostgresStoreOptions::new(
|
||||
profile.database.postgres.url.clone(),
|
||||
profile.database.postgres.max_connections,
|
||||
profile.database.postgres.connect_timeout_ms,
|
||||
false,
|
||||
)
|
||||
.unwrap_or_else(|error| panic!("PostgreSQL options failed: {error}"));
|
||||
let store = ks_store::PostgresStore::connect(store_options)
|
||||
.await
|
||||
.unwrap_or_else(|error| panic!("PostgreSQL connection failed: {error}"));
|
||||
if let std::result::Result::Err(error) = store.initialize_store_schema().await {
|
||||
panic!("PostgreSQL schema initialization failed: {error}");
|
||||
}
|
||||
let store = match crate::open_profile_store(&profile).await {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => panic!("Store connection failed: {error}"),
|
||||
};
|
||||
let configured_wallet_dir =
|
||||
std::path::PathBuf::from(profile.wallet.temporary_wallet_dir.as_str());
|
||||
let wallet_dir = if configured_wallet_dir.is_absolute() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: ks-pipeline-demo-scenarios/src/metadata/metaplex_token_metadata/print_burn_campaign.rs
|
||||
// version: 10
|
||||
// version: 12
|
||||
|
||||
//! Devnet printable master NFT `Print -> Burn` campaign.
|
||||
|
||||
@@ -1210,23 +1210,14 @@ mod tests {
|
||||
.unwrap_or_else(|error| panic!("Devnet profile resolution failed: {error}"));
|
||||
let database_url = std::env::var("KS_SECRET_POSTGRES_TEST_URL")
|
||||
.unwrap_or_else(|error| panic!("KS_SECRET_POSTGRES_TEST_URL is required: {error}"));
|
||||
profile.database.backend = "postgres".to_string();
|
||||
profile.database.postgres.url = database_url;
|
||||
crate::override_profile_store_url_for_test(&mut profile, database_url)
|
||||
.unwrap_or_else(|error| panic!("Store test override failed: {error}"));
|
||||
let pool = ks_onchain_transport::HttpEndpointPool::from_profile(&profile)
|
||||
.unwrap_or_else(|error| panic!("HTTP pool creation failed: {error}"));
|
||||
let store_options = ks_store::PostgresStoreOptions::new(
|
||||
profile.database.postgres.url.clone(),
|
||||
profile.database.postgres.max_connections,
|
||||
profile.database.postgres.connect_timeout_ms,
|
||||
false,
|
||||
)
|
||||
.unwrap_or_else(|error| panic!("PostgreSQL options failed: {error}"));
|
||||
let store = ks_store::PostgresStore::connect(store_options)
|
||||
.await
|
||||
.unwrap_or_else(|error| panic!("PostgreSQL connection failed: {error}"));
|
||||
if let std::result::Result::Err(error) = store.initialize_store_schema().await {
|
||||
panic!("PostgreSQL schema initialization failed: {error}");
|
||||
}
|
||||
let store = match crate::open_profile_store(&profile).await {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => panic!("Store connection failed: {error}"),
|
||||
};
|
||||
let configured_wallet_dir =
|
||||
std::path::PathBuf::from(profile.wallet.temporary_wallet_dir.as_str());
|
||||
let wallet_dir = if configured_wallet_dir.is_absolute() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: ks-pipeline-demo-scenarios/src/metadata/metaplex_token_metadata/use_campaign.rs
|
||||
// version: 7
|
||||
// version: 9
|
||||
|
||||
//! Bounded Devnet availability probe for the current Metaplex `Use` surface.
|
||||
|
||||
@@ -455,23 +455,14 @@ mod tests {
|
||||
.unwrap_or_else(|error| panic!("Devnet profile resolution failed: {error}"));
|
||||
let database_url = std::env::var("KS_SECRET_POSTGRES_TEST_URL")
|
||||
.unwrap_or_else(|error| panic!("KS_SECRET_POSTGRES_TEST_URL is required: {error}"));
|
||||
profile.database.backend = "postgres".to_string();
|
||||
profile.database.postgres.url = database_url;
|
||||
crate::override_profile_store_url_for_test(&mut profile, database_url)
|
||||
.unwrap_or_else(|error| panic!("Store test override failed: {error}"));
|
||||
let http_pool = ks_onchain_transport::HttpEndpointPool::from_profile(&profile)
|
||||
.unwrap_or_else(|error| panic!("HTTP pool initialization failed: {error}"));
|
||||
let store_options = ks_store::PostgresStoreOptions::new(
|
||||
profile.database.postgres.url.clone(),
|
||||
profile.database.postgres.max_connections,
|
||||
profile.database.postgres.connect_timeout_ms,
|
||||
false,
|
||||
)
|
||||
.unwrap_or_else(|error| panic!("PostgreSQL options failed: {error}"));
|
||||
let store = ks_store::PostgresStore::connect(store_options)
|
||||
.await
|
||||
.unwrap_or_else(|error| panic!("PostgreSQL connection failed: {error}"));
|
||||
if let std::result::Result::Err(error) = store.initialize_store_schema().await {
|
||||
panic!("PostgreSQL schema initialization failed: {error}");
|
||||
}
|
||||
let store = match crate::open_profile_store(&profile).await {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => panic!("Store connection failed: {error}"),
|
||||
};
|
||||
let configured_wallet_dir =
|
||||
std::path::PathBuf::from(profile.wallet.temporary_wallet_dir.as_str());
|
||||
let wallet_dir = if configured_wallet_dir.is_absolute() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: ks-pipeline-demo-scenarios/src/solana.rs
|
||||
// version: 18
|
||||
// version: 20
|
||||
|
||||
//! Devnet Solana execution orchestration with canonical post-validation.
|
||||
|
||||
@@ -1544,8 +1544,8 @@ mod tests {
|
||||
},
|
||||
};
|
||||
let mut profile = example_devnet_profile();
|
||||
profile.database.backend = "postgres".to_string();
|
||||
profile.database.postgres.url = database_url;
|
||||
crate::override_profile_store_url_for_test(&mut profile, database_url)
|
||||
.unwrap_or_else(|error| panic!("Store test override failed: {error}"));
|
||||
if let std::result::Result::Ok(directory) = std::env::var("KS_DEVNET_WALLET_DIR") {
|
||||
profile.wallet.temporary_wallet_dir = directory;
|
||||
}
|
||||
@@ -1553,22 +1553,10 @@ mod tests {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => panic!("HTTP pool creation failed: {error}"),
|
||||
};
|
||||
let store_options = match ks_store::PostgresStoreOptions::new(
|
||||
profile.database.postgres.url.clone(),
|
||||
profile.database.postgres.max_connections,
|
||||
profile.database.postgres.connect_timeout_ms,
|
||||
false,
|
||||
) {
|
||||
let store = match crate::open_profile_store(&profile).await {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => panic!("PostgreSQL options failed: {error}"),
|
||||
std::result::Result::Err(error) => panic!("Store connection failed: {error}"),
|
||||
};
|
||||
let store = match ks_store::PostgresStore::connect(store_options).await {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => panic!("PostgreSQL connection failed: {error}"),
|
||||
};
|
||||
if let std::result::Result::Err(error) = store.initialize_store_schema().await {
|
||||
panic!("PostgreSQL schema initialization failed: {error}");
|
||||
}
|
||||
let recipient_alias = match ks_wallet::WalletAlias::parse("devnet-recipient") {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => panic!("recipient alias failed: {error}"),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: ks-pipeline-demo-scenarios/src/spl/associated_token_account.rs
|
||||
// version: 17
|
||||
// version: 19
|
||||
|
||||
//! Devnet ATA execution with stateful and canonical post-validation.
|
||||
|
||||
@@ -1162,20 +1162,10 @@ mod tests {
|
||||
request.post_validation_max_retries = 20;
|
||||
let pool = ks_onchain_transport::HttpEndpointPool::from_profile(&profile)
|
||||
.unwrap_or_else(|error| panic!("HTTP pool failed: {error}"));
|
||||
let store_options = ks_store::PostgresStoreOptions::new(
|
||||
profile.database.postgres.url.clone(),
|
||||
profile.database.postgres.max_connections,
|
||||
profile.database.postgres.connect_timeout_ms,
|
||||
false,
|
||||
)
|
||||
.unwrap_or_else(|error| panic!("PostgreSQL options failed: {error}"));
|
||||
let store = ks_store::PostgresStore::connect(store_options)
|
||||
.await
|
||||
.unwrap_or_else(|error| panic!("PostgreSQL connection failed: {error}"));
|
||||
store
|
||||
.initialize_store_schema()
|
||||
.await
|
||||
.unwrap_or_else(|error| panic!("schema initialization failed: {error}"));
|
||||
let store = match crate::open_profile_store(&profile).await {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => panic!("Store connection failed: {error}"),
|
||||
};
|
||||
let decoders: std::vec::Vec<std::sync::Arc<dyn ks_lib::DcApiInstructionDecoder>> = std::vec![
|
||||
std::sync::Arc::new(ks_lib::DcSplAssociatedTokenAccountDecoder),
|
||||
std::sync::Arc::new(ks_lib::DcSplTokenDecoder),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: ks-pipeline-demo-scenarios/src/spl/memo.rs
|
||||
// version: 13
|
||||
// version: 15
|
||||
|
||||
//! Devnet SPL Memo v4 execution with canonical post-validation.
|
||||
|
||||
@@ -857,8 +857,8 @@ mod tests {
|
||||
},
|
||||
};
|
||||
let mut profile = example_devnet_profile();
|
||||
profile.database.backend = "postgres".to_string();
|
||||
profile.database.postgres.url = database_url;
|
||||
crate::override_profile_store_url_for_test(&mut profile, database_url)
|
||||
.unwrap_or_else(|error| panic!("Store test override failed: {error}"));
|
||||
if let std::result::Result::Ok(directory) = std::env::var("KS_DEVNET_WALLET_DIR") {
|
||||
profile.wallet.temporary_wallet_dir = directory;
|
||||
}
|
||||
@@ -866,22 +866,10 @@ mod tests {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => panic!("HTTP pool creation failed: {error}"),
|
||||
};
|
||||
let store_options = match ks_store::PostgresStoreOptions::new(
|
||||
profile.database.postgres.url.clone(),
|
||||
profile.database.postgres.max_connections,
|
||||
profile.database.postgres.connect_timeout_ms,
|
||||
false,
|
||||
) {
|
||||
let store = match crate::open_profile_store(&profile).await {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => panic!("PostgreSQL options failed: {error}"),
|
||||
std::result::Result::Err(error) => panic!("Store connection failed: {error}"),
|
||||
};
|
||||
let store = match ks_store::PostgresStore::connect(store_options).await {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => panic!("PostgreSQL connection failed: {error}"),
|
||||
};
|
||||
if let std::result::Result::Err(error) = store.initialize_store_schema().await {
|
||||
panic!("PostgreSQL schema initialization failed: {error}");
|
||||
}
|
||||
let mut request = crate::DevnetMemoExecutionRequest::new(
|
||||
format!("devnet-memo-test-{}", uuid::Uuid::new_v4()),
|
||||
format!("khadhroony-bot3 memo validation {}", uuid::Uuid::new_v4()),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: ks-pipeline-demo-scenarios/src/spl/token/execution.rs
|
||||
// version: 17
|
||||
// version: 19
|
||||
|
||||
//! Devnet classic SPL Token execution with stateful and canonical post-validation.
|
||||
|
||||
@@ -1189,24 +1189,12 @@ mod tests {
|
||||
panic!("KS_SECRET_POSTGRES_TEST_URL is required for submission: {error}");
|
||||
},
|
||||
};
|
||||
profile.database.backend = "postgres".to_string();
|
||||
profile.database.postgres.url = database_url;
|
||||
let store_options = match ks_store::PostgresStoreOptions::new(
|
||||
profile.database.postgres.url.clone(),
|
||||
profile.database.postgres.max_connections,
|
||||
profile.database.postgres.connect_timeout_ms,
|
||||
false,
|
||||
) {
|
||||
crate::override_profile_store_url_for_test(&mut profile, database_url)
|
||||
.unwrap_or_else(|error| panic!("Store test override failed: {error}"));
|
||||
let store = match crate::open_profile_store(&profile).await {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => panic!("PostgreSQL options failed: {error}"),
|
||||
std::result::Result::Err(error) => panic!("Store connection failed: {error}"),
|
||||
};
|
||||
let store = match ks_store::PostgresStore::connect(store_options).await {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => panic!("PostgreSQL connection failed: {error}"),
|
||||
};
|
||||
if let std::result::Result::Err(error) = store.initialize_store_schema().await {
|
||||
panic!("PostgreSQL schema initialization failed: {error}");
|
||||
}
|
||||
let decoders: std::vec::Vec<std::sync::Arc<dyn ks_lib::DcApiInstructionDecoder>> =
|
||||
std::vec![std::sync::Arc::new(ks_lib::DcSplTokenDecoder)];
|
||||
let materializers: std::vec::Vec<std::sync::Arc<dyn ks_lib::MtApiEventMaterializer>> =
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: ks-pipeline-demo-scenarios/src/spl/token/lifecycle.rs
|
||||
// version: 16
|
||||
// version: 18
|
||||
|
||||
//! Controlled Devnet lifecycle for freshly prepared classic SPL Token accounts.
|
||||
|
||||
@@ -1520,28 +1520,16 @@ mod tests {
|
||||
panic!("KS_SECRET_POSTGRES_TEST_URL is required for lifecycle submission: {error}");
|
||||
},
|
||||
};
|
||||
profile.database.backend = "postgres".to_string();
|
||||
profile.database.postgres.url = database_url;
|
||||
crate::override_profile_store_url_for_test(&mut profile, database_url)
|
||||
.unwrap_or_else(|error| panic!("Store test override failed: {error}"));
|
||||
let pool = match ks_onchain_transport::HttpEndpointPool::from_profile(&profile) {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => panic!("HTTP pool creation failed: {error}"),
|
||||
};
|
||||
let store_options = match ks_store::PostgresStoreOptions::new(
|
||||
profile.database.postgres.url.clone(),
|
||||
profile.database.postgres.max_connections,
|
||||
profile.database.postgres.connect_timeout_ms,
|
||||
false,
|
||||
) {
|
||||
let store = match crate::open_profile_store(&profile).await {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => panic!("PostgreSQL options failed: {error}"),
|
||||
std::result::Result::Err(error) => panic!("Store connection failed: {error}"),
|
||||
};
|
||||
let store = match ks_store::PostgresStore::connect(store_options).await {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => panic!("PostgreSQL connection failed: {error}"),
|
||||
};
|
||||
if let std::result::Result::Err(error) = store.initialize_store_schema().await {
|
||||
panic!("PostgreSQL schema initialization failed: {error}");
|
||||
}
|
||||
let workspace_root = match std::path::Path::new(env!("CARGO_MANIFEST_DIR")).parent() {
|
||||
std::option::Option::Some(value) => value,
|
||||
std::option::Option::None => panic!("workspace root cannot be resolved"),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: ks-pipeline-demo-scenarios/src/spl/token_2022/metadata/campaign.rs
|
||||
// version: 10
|
||||
// version: 12
|
||||
|
||||
//! Ordered confirmed Devnet campaign for the five Token-2022 Token Metadata instructions.
|
||||
|
||||
@@ -529,23 +529,14 @@ mod tests {
|
||||
.unwrap_or_else(|error| panic!("Devnet profile resolution failed: {error}"));
|
||||
let database_url = std::env::var("KS_SECRET_POSTGRES_TEST_URL")
|
||||
.unwrap_or_else(|error| panic!("KS_SECRET_POSTGRES_TEST_URL is required: {error}"));
|
||||
profile.database.backend = "postgres".to_string();
|
||||
profile.database.postgres.url = database_url;
|
||||
crate::override_profile_store_url_for_test(&mut profile, database_url)
|
||||
.unwrap_or_else(|error| panic!("Store test override failed: {error}"));
|
||||
let pool = ks_onchain_transport::HttpEndpointPool::from_profile(&profile)
|
||||
.unwrap_or_else(|error| panic!("HTTP pool creation failed: {error}"));
|
||||
let store_options = ks_store::PostgresStoreOptions::new(
|
||||
profile.database.postgres.url.clone(),
|
||||
profile.database.postgres.max_connections,
|
||||
profile.database.postgres.connect_timeout_ms,
|
||||
false,
|
||||
)
|
||||
.unwrap_or_else(|error| panic!("PostgreSQL options failed: {error}"));
|
||||
let store = ks_store::PostgresStore::connect(store_options)
|
||||
.await
|
||||
.unwrap_or_else(|error| panic!("PostgreSQL connection failed: {error}"));
|
||||
if let std::result::Result::Err(error) = store.initialize_store_schema().await {
|
||||
panic!("PostgreSQL schema initialization failed: {error}");
|
||||
}
|
||||
let store = match crate::open_profile_store(&profile).await {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => panic!("Store connection failed: {error}"),
|
||||
};
|
||||
let configured_wallet_dir =
|
||||
std::path::PathBuf::from(profile.wallet.temporary_wallet_dir.as_str());
|
||||
let wallet_dir = if configured_wallet_dir.is_absolute() {
|
||||
|
||||
Reference in New Issue
Block a user