feat(fifa17): attach economy services in Server::from_config
Wire the PRODUCTION constructor so the economy authority is not test-only. Server::from_config now builds one process-lifetime AsyncBridge, opens the durable MarketStore + PileStore (paths from config), shares one HttpCoreClient as both CoreAccess and CoreEconomy, builds the content pool from Core, and attaches EconomyServices via with_economy. Stores/bridge are host-lifetime, never per request. - config.rs: required OPENFUT_MARKET_DB / OPENFUT_PILE_DB (durable file paths; must survive host restart — no temp defaults). - Fail-closed startup: a bridge/store that cannot initialize returns Err from from_config (host refuses to start) — NEVER a silent omission or a Python economy fallback. Test: from_config_constructs_and_serves_economy — builds the Server via the REAL from_config (disposable config: temp market/pile/identity + a catalog file derived from seeded content + the real tables dir) against a live Core, drives credits / purchasegroup / Store BUY / market list-query-buy through it, then rebuilds from the SAME config after a Core restart and asserts the balance persisted. host 71 lib + 3 integration + 24 host_test green; clippy/fmt clean.
This commit is contained in:
@@ -27,6 +27,13 @@ pub struct HostConfig {
|
||||
/// Required, non-zero: it stamps `personaId` on the Core-backed
|
||||
/// `GET /squad/active`, and must match the persona LSX/Blaze/POW/UTAS use.
|
||||
pub persona_id: i64,
|
||||
/// Durable FIFA17 transfer-market listing DB (host-owned SQLite). Required
|
||||
/// for the economy cutover; must survive host restart (a real path, not a
|
||||
/// temp file). Env `OPENFUT_MARKET_DB`.
|
||||
pub market_db_path: String,
|
||||
/// Durable FIFA17 item-pile metadata DB (host-owned SQLite). Required; must
|
||||
/// survive host restart. Env `OPENFUT_PILE_DB`.
|
||||
pub pile_db_path: String,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
@@ -71,6 +78,8 @@ impl HostConfig {
|
||||
catalog_path: required("OPENFUT_FIFA17_CATALOG")?,
|
||||
identity_store_path: required("OPENFUT_IDENTITY_STORE")?,
|
||||
persona_id: required_i64_nonzero("OPENFUT_PERSONA_ID")?,
|
||||
market_db_path: required("OPENFUT_MARKET_DB")?,
|
||||
pile_db_path: required("OPENFUT_PILE_DB")?,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user