From 8929597863df2588977eb37ab4a7e867805b673c Mon Sep 17 00:00:00 2001 From: Chase Fleming <1666730+chasefleming@users.noreply.github.com> Date: Tue, 19 Nov 2024 13:05:27 -0800 Subject: [PATCH 1/2] Fix alias failing in Dependency Manager if contract doesn't exist --- internal/dependencymanager/dependencyinstaller.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/internal/dependencymanager/dependencyinstaller.go b/internal/dependencymanager/dependencyinstaller.go index f902b1d87..fd724cd62 100644 --- a/internal/dependencymanager/dependencyinstaller.go +++ b/internal/dependencymanager/dependencyinstaller.go @@ -446,8 +446,15 @@ func (di *DependencyInstaller) handleFoundContract(networkName, contractAddr, as } } + err := di.updateDependencyState(networkName, contractAddr, assignedName, contractName, originalContractDataHash) + if err != nil { + di.Logger.Error(fmt.Sprintf("Error updating state: %v", err)) + return err + } + // Needs to happen before handleFileSystem if !di.contractFileExists(contractAddr, contractName) { + fmt.Println("Contract file does not exist") err := di.handleAdditionalDependencyTasks(networkName, contractName) if err != nil { di.Logger.Error(fmt.Sprintf("Error handling additional dependency tasks: %v", err)) @@ -455,17 +462,11 @@ func (di *DependencyInstaller) handleFoundContract(networkName, contractAddr, as } } - err := di.handleFileSystem(contractAddr, contractName, contractData, networkName) + err = di.handleFileSystem(contractAddr, contractName, contractData, networkName) if err != nil { return fmt.Errorf("error handling file system: %w", err) } - err = di.updateDependencyState(networkName, contractAddr, assignedName, contractName, originalContractDataHash) - if err != nil { - di.Logger.Error(fmt.Sprintf("Error updating state: %v", err)) - return err - } - return nil } From 75c367405b01791531e452f55cebb0a68fa4d6e5 Mon Sep 17 00:00:00 2001 From: Chase Fleming <1666730+chasefleming@users.noreply.github.com> Date: Tue, 19 Nov 2024 13:10:26 -0800 Subject: [PATCH 2/2] Remove --- internal/dependencymanager/dependencyinstaller.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/dependencymanager/dependencyinstaller.go b/internal/dependencymanager/dependencyinstaller.go index fd724cd62..84963a020 100644 --- a/internal/dependencymanager/dependencyinstaller.go +++ b/internal/dependencymanager/dependencyinstaller.go @@ -454,7 +454,6 @@ func (di *DependencyInstaller) handleFoundContract(networkName, contractAddr, as // Needs to happen before handleFileSystem if !di.contractFileExists(contractAddr, contractName) { - fmt.Println("Contract file does not exist") err := di.handleAdditionalDependencyTasks(networkName, contractName) if err != nil { di.Logger.Error(fmt.Sprintf("Error handling additional dependency tasks: %v", err))