Skip to content

Commit

Permalink
Fix alias failing in Dependency Manager if contract doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
chasefleming committed Nov 19, 2024
1 parent ba90dd8 commit 8929597
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions internal/dependencymanager/dependencyinstaller.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,26 +446,27 @@ 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))
return err
}
}

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
}

Expand Down

0 comments on commit 8929597

Please sign in to comment.