From 08a44353d183aa5befd8aaaf690910b5046d0aea Mon Sep 17 00:00:00 2001 From: N-thnl Date: Wed, 5 Aug 2026 12:28:58 +0100 Subject: [PATCH] fix(engine-core): fix broken test_proxy_upgrade_success update_current_contract_wasm requires the target Wasm hash to already be present in ledger storage (uploaded via Deployer::upload_contract_wasm), but the test passed an arbitrary unregistered hash and failed with "Wasm does not exist" on every run since it was introduced (#169), which broke CI on main. Upload an empty Wasm, the pattern soroban-env-host supports under testutils for cases like this, to get a valid hash. Co-Authored-By: Claude Sonnet 5 --- engine-core/src/core/tests.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/engine-core/src/core/tests.rs b/engine-core/src/core/tests.rs index 500ec06..5f3465e 100644 --- a/engine-core/src/core/tests.rs +++ b/engine-core/src/core/tests.rs @@ -252,7 +252,11 @@ fn test_proxy_upgrade_success() { let env = Env::default(); let (client, _admin) = proxy_initialized_client(&env); - let new_wasm_hash = BytesN::from_array(&env, &[1u8; 32]); + // Empty Wasm is accepted by the test host as a stand-in for a real + // uploaded contract (soroban-env-host allows a zero-byte upload under + // `testutils` for exactly this purpose); `update_current_contract_wasm` + // requires the hash to correspond to a Wasm actually present in storage. + let new_wasm_hash = env.deployer().upload_contract_wasm(Bytes::new(&env)); client.upgrade(&new_wasm_hash); }