Skip to content

Commit

Permalink
fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
axenteoctavian committed Nov 22, 2024
1 parent b2a967c commit 1559ae8
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 18 deletions.
12 changes: 6 additions & 6 deletions cmd/proxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ VERSION:
Name: "start-swagger-ui",
Usage: "If set to true, will start a Swagger UI on the root",
}
// sovereignConfig defines a flag that specifies if what run type components should use
sovereignConfig = cli.BoolFlag{
// sovereign defines a flag that specifies if what run type components should use
sovereign = cli.BoolFlag{
Name: "sovereign-config",
Usage: "If set to true, will use sovereign run type components",
}
Expand Down Expand Up @@ -192,7 +192,7 @@ func main() {
workingDirectory,
memBallast,
startSwaggerUI,
sovereignConfig,
sovereign,
}
app.Authors = []cli.Author{
{
Expand Down Expand Up @@ -381,8 +381,8 @@ func createVersionsRegistryTestOrProduction(
statusMetricsHandler,
ctx.GlobalString(walletKeyPemFile.Name),
ctx.GlobalString(apiConfigDirectory.Name),
ctx.GlobalBool(sovereign.Name),
closableComponents,
ctx.GlobalBool(sovereignConfig.Name),
)
}

Expand All @@ -392,8 +392,8 @@ func createVersionsRegistryTestOrProduction(
statusMetricsHandler,
ctx.GlobalString(walletKeyPemFile.Name),
ctx.GlobalString(apiConfigDirectory.Name),
ctx.GlobalBool(sovereign.Name),
closableComponents,
ctx.GlobalBool(sovereignConfig.Name),
)
}

Expand All @@ -403,8 +403,8 @@ func createVersionsRegistry(
statusMetricsHandler data.StatusMetricsProvider,
pemFileLocation string,
apiConfigDirectoryPath string,
closableComponents *data.ClosableComponentsHandler,
isSovereignConfig bool,
closableComponents *data.ClosableComponentsHandler,
) (data.VersionsRegistryHandler, error) {
pubKeyConverter, err := pubkeyConverter.NewBech32PubkeyConverter(cfg.AddressPubkeyConverter.Length, addressHRP)
if err != nil {
Expand Down
8 changes: 0 additions & 8 deletions factory/errors.go

This file was deleted.

6 changes: 6 additions & 0 deletions factory/runType/runTypeComponents.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
package runType

import (
"errors"
)

var errNilRunTypeComponents = errors.New("nil run type components")

type runTypeComponents struct{}

// Close does nothing
Expand Down
4 changes: 2 additions & 2 deletions factory/runType/runTypeComponentsHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type managedRunTypeComponents struct {
// NewManagedRunTypeComponents returns a news instance of managed runType core components
func NewManagedRunTypeComponents(rtc RunTypeComponentsCreator) (*managedRunTypeComponents, error) {
if rtc == nil {
return nil, factory.ErrNilRunTypeComponents
return nil, errNilRunTypeComponents
}

return &managedRunTypeComponents{
Expand Down Expand Up @@ -67,7 +67,7 @@ func (mrtc *managedRunTypeComponents) CheckSubcomponents() error {
defer mrtc.mutRunTypeCoreComponents.RUnlock()

if check.IfNil(mrtc.runTypeComponents) {
return factory.ErrNilRunTypeComponents
return errNilRunTypeComponents
}
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions factory/runType/runTypeComponentsHandler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func TestNewManagedRunTypeComponents(t *testing.T) {

t.Run("should error", func(t *testing.T) {
managedRunTypeComponents, err := NewManagedRunTypeComponents(nil)
require.ErrorIs(t, err, factory.ErrNilRunTypeComponents)
require.ErrorIs(t, err, errNilRunTypeComponents)
require.True(t, managedRunTypeComponents.IsInterfaceNil())
})
t.Run("should work", func(t *testing.T) {
Expand Down Expand Up @@ -63,7 +63,7 @@ func TestManagedRunTypeComponents_CheckSubcomponents(t *testing.T) {

managedRunTypeComponents, _ := createComponents()
err := managedRunTypeComponents.CheckSubcomponents()
require.Equal(t, factory.ErrNilRunTypeComponents, err)
require.Equal(t, errNilRunTypeComponents, err)

err = managedRunTypeComponents.Create()
require.NoError(t, err)
Expand Down

0 comments on commit 1559ae8

Please sign in to comment.