Skip to content

Commit

Permalink
fix: deploy empty kernel address
Browse files Browse the repository at this point in the history
  • Loading branch information
crnbarr93 committed Nov 8, 2024
1 parent c7b73d6 commit 9faff48
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 5 additions & 2 deletions packages/deploy/src/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,13 @@ impl OperatingSystemDeployment {
pub fn instantiate(&self, kernel_address: Option<String>) -> 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 {
Expand Down

0 comments on commit 9faff48

Please sign in to comment.