Overview
The factory contract's test.rs is missing tests for several critical paths. The following scenarios are untested and could mask regressions:
Missing Test Cases
initialize
transfer_admin
create_pool
get_pool
pool_wasm_hash
Setup Note
Use soroban_sdk::testutils::EnvBuilder with register_at to install a mock WASM hash for pool deployment tests.
Acceptance Criteria
Overview
The factory contract's
test.rsis missing tests for several critical paths. The following scenarios are untested and could mask regressions:Missing Test Cases
initializeErr(FactoryError::AlreadyInitialized)— not just that it errors, but that the error code matchespool_countis exactly 0 immediately after inittransfer_admintransfer_adminis rejectedcreate_pooladm_xfrevent emitted with correct(old, new)payloadcreate_poolcreate_poolcreate_poolis rejectedpool_countincrements by 1 for each created poolpool_crtdevent includes correctasset,daily_rate,min_lock_periodpayloadget_pool(0)still returns ID 0's dataget_poolpool_idbeyondpool_countreturnsErr(FactoryError::PoolNotFound)get_poolcall (verify via storage TTL inspection)pool_wasm_hashSetup Note
Use
soroban_sdk::testutils::EnvBuilderwithregister_atto install a mock WASM hash for pool deployment tests.Acceptance Criteria
factory/src/test.rs#[test]function nameunwrap()in test assertions — useassert_eq!withOk(...)\ /Err(...)`cargo test