Skip to content

Commit

Permalink
Merge pull request #1743 from onflow/cf/1742
Browse files Browse the repository at this point in the history
Remove previewnet on dependency manager
  • Loading branch information
chasefleming authored Sep 16, 2024
2 parents 2d0550a + ea02c76 commit 620ddaa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 21 deletions.
18 changes: 5 additions & 13 deletions internal/dependencymanager/dependencyinstaller.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,10 @@ func NewDependencyInstaller(logger output.Logger, state *flowkit.State, saveStat
return nil, fmt.Errorf("error creating mainnet gateway: %v", err)
}

previewnetGateway, err := gateway.NewGrpcGateway(config.PreviewnetNetwork)
if err != nil {
return nil, fmt.Errorf("error creating previewnet gateway: %v", err)
}

gateways := map[string]gateway.Gateway{
config.EmulatorNetwork.Name: emulatorGateway,
config.TestnetNetwork.Name: testnetGateway,
config.MainnetNetwork.Name: mainnetGateway,
config.PreviewnetNetwork.Name: previewnetGateway,
config.EmulatorNetwork.Name: emulatorGateway,
config.TestnetNetwork.Name: testnetGateway,
config.MainnetNetwork.Name: mainnetGateway,
}

return &DependencyInstaller{
Expand Down Expand Up @@ -508,11 +502,9 @@ func (di *DependencyInstaller) updateDependencyAlias(contractName, aliasNetwork

switch aliasNetwork {
case config.MainnetNetwork.Name:
missingNetworks = []string{config.TestnetNetwork.Name, config.PreviewnetNetwork.Name}
missingNetworks = []string{config.TestnetNetwork.Name}
case config.TestnetNetwork.Name:
missingNetworks = []string{config.MainnetNetwork.Name, config.PreviewnetNetwork.Name}
case config.PreviewnetNetwork.Name:
missingNetworks = []string{config.MainnetNetwork.Name, config.TestnetNetwork.Name}
missingNetworks = []string{config.MainnetNetwork.Name}
}

for _, missingNetwork := range missingNetworks {
Expand Down
14 changes: 6 additions & 8 deletions internal/dependencymanager/dependencyinstaller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,9 @@ func TestDependencyInstallerInstall(t *testing.T) {

di := &DependencyInstaller{
Gateways: map[string]gateway.Gateway{
config.EmulatorNetwork.Name: gw.Mock,
config.TestnetNetwork.Name: gw.Mock,
config.MainnetNetwork.Name: gw.Mock,
config.PreviewnetNetwork.Name: gw.Mock,
config.EmulatorNetwork.Name: gw.Mock,
config.TestnetNetwork.Name: gw.Mock,
config.MainnetNetwork.Name: gw.Mock,
},
Logger: logger,
State: state,
Expand Down Expand Up @@ -118,10 +117,9 @@ func TestDependencyInstallerAdd(t *testing.T) {

di := &DependencyInstaller{
Gateways: map[string]gateway.Gateway{
config.EmulatorNetwork.Name: gw.Mock,
config.TestnetNetwork.Name: gw.Mock,
config.MainnetNetwork.Name: gw.Mock,
config.PreviewnetNetwork.Name: gw.Mock,
config.EmulatorNetwork.Name: gw.Mock,
config.TestnetNetwork.Name: gw.Mock,
config.MainnetNetwork.Name: gw.Mock,
},
Logger: logger,
State: state,
Expand Down

0 comments on commit 620ddaa

Please sign in to comment.