From 9faff4899b4c5f77fee6b6932762fd9e58dc552c Mon Sep 17 00:00:00 2001 From: Connor Barr Date: Fri, 8 Nov 2024 15:05:57 +0000 Subject: [PATCH] fix: deploy empty kernel address --- Makefile | 1 - packages/deploy/src/os.rs | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index c83e25698..31dc79c47 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,6 @@ build-arm: @echo "Building all contracts..." @./scripts/build_all_arm.sh || exit 1 @echo "Build complete! \033[0;32m\xE2\x9C\x94\033[0m" - @./scripts/build_version_map.sh || exit 1 # Attaches contract versions to the wasm files attach-contract-versions: diff --git a/packages/deploy/src/os.rs b/packages/deploy/src/os.rs index e4d157741..f430d190b 100644 --- a/packages/deploy/src/os.rs +++ b/packages/deploy/src/os.rs @@ -52,10 +52,13 @@ impl OperatingSystemDeployment { pub fn instantiate(&self, kernel_address: Option) -> Result<(), DeployError> { let sender = self.daemon.sender().address(); + let has_kernel_address = + kernel_address.is_some() && !kernel_address.clone().unwrap().is_empty(); // If kernel address is provided, use it and migrate the contract to the new version - if let Some(address) = kernel_address { + if has_kernel_address { let code_id = self.kernel.code_id().unwrap(); - self.kernel.set_address(&Addr::unchecked(address)); + self.kernel + .set_address(&Addr::unchecked(kernel_address.unwrap())); self.kernel.migrate(&MigrateMsg {}, code_id)?; } else { let kernel_msg = kernel::InstantiateMsg {