From a21e9f7b601034fb9787e0d2e42a20cb9d18593d Mon Sep 17 00:00:00 2001 From: Supun Setunga Date: Thu, 29 Aug 2024 15:14:11 -0700 Subject: [PATCH] Remove unused function --- internal/migrate/migrate.go | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/internal/migrate/migrate.go b/internal/migrate/migrate.go index c5a6b938e..537596035 100644 --- a/internal/migrate/migrate.go +++ b/internal/migrate/migrate.go @@ -19,13 +19,8 @@ package migrate import ( - "fmt" - "github.com/cenkalti/backoff/v4" - "github.com/onflow/cadence" "github.com/onflow/flow-go-sdk" - "github.com/onflow/flowkit/v2" - "github.com/onflow/flowkit/v2/project" "github.com/spf13/cobra" ) @@ -58,38 +53,6 @@ func MigrationContractStagingAddress(network string) flow.Address { return flow.HexToAddress(migrationContractStagingAddress[network]) } -// replaceImportsIfExists replaces imports in the given contract file with the actual contract code -func replaceImportsIfExists(state *flowkit.State, flow flowkit.Services, location string) ([]byte, error) { - code, err := state.ReadFile(location) - if err != nil { - return nil, fmt.Errorf("error loading contract file: %w", err) - } - - contracts, err := state.DeploymentContractsByNetwork(flow.Network()) - if err != nil { - return nil, err - } - - importReplacer := project.NewImportReplacer( - contracts, - state.AliasesForNetwork(flow.Network()), - ) - - program, err := project.NewProgram(code, []cadence.Value{}, location) - if err != nil { - return nil, err - } - - if program.HasImports() { - program, err = importReplacer.Replace(program) - if err != nil { - return nil, err - } - } - - return program.Code(), nil -} - func withRetry(operation func() error) error { return backoff.Retry( operation,