Skip to content

Commit

Permalink
fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
sstanculeanu committed Sep 13, 2022
1 parent dcccc80 commit c52b27f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
9 changes: 5 additions & 4 deletions cmd/node/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ func main() {
app.Name = "Elrond Node CLI App"
machineID := core.GetAnonymizedMachineID(app.Name)

app.Version = fmt.Sprintf("%s/%s/%s-%s/%s", appVersion, runtime.Version(), runtime.GOOS, runtime.GOARCH, machineID)
baseVersion := fmt.Sprintf("%s/%s/%s-%s", appVersion, runtime.Version(), runtime.GOOS, runtime.GOARCH)
app.Version = fmt.Sprintf("%s/%s", baseVersion, machineID)
app.Usage = "This is the entry point for starting a new Elrond node - the app will start after the genesis timestamp"
app.Flags = getFlags()
app.Authors = []cli.Author{
Expand All @@ -73,7 +74,7 @@ func main() {
}

app.Action = func(c *cli.Context) error {
return startNodeRunner(c, log, app.Version)
return startNodeRunner(c, log, baseVersion, app.Version)
}

err := app.Run(os.Args)
Expand All @@ -83,7 +84,7 @@ func main() {
}
}

func startNodeRunner(c *cli.Context, log logger.Logger, version string) error {
func startNodeRunner(c *cli.Context, log logger.Logger, baseVersion string, version string) error {
flagsConfig := getFlagsConfig(c, log)

fileLogging, errLogger := attachFileLogger(log, flagsConfig)
Expand Down Expand Up @@ -119,7 +120,7 @@ func startNodeRunner(c *cli.Context, log logger.Logger, version string) error {
log.Debug("initialized memory ballast object", "size", core.ConvertBytes(uint64(len(memoryBallastObject))))
}

cfgs.FlagsConfig.BaseVersion = fmt.Sprintf("%s-base", version)
cfgs.FlagsConfig.BaseVersion = baseVersion
cfgs.FlagsConfig.Version = version

nodeRunner, errRunner := node.NewNodeRunner(cfgs)
Expand Down
2 changes: 1 addition & 1 deletion heartbeat/sender/heartbeatSenderFactory.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func isMultikeyMode(privKey crypto.PrivateKey, keysHolder heartbeat.KeysHolder,

_, _, err = nodesCoordinator.GetValidatorWithPublicKey(pkBytes)
if err == nil && isMultikey {
return false, heartbeat.ErrInvalidConfiguration
return false, fmt.Errorf("%w, len(keysMap) = %d, isValidator = %v", heartbeat.ErrInvalidConfiguration, len(keysMap), err == nil)
}

return isMultikey, nil
Expand Down
2 changes: 2 additions & 0 deletions heartbeat/sender/heartbeatSenderFactory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package sender
import (
"errors"
"fmt"
"strings"
"testing"

"github.com/ElrondNetwork/elrond-go-core/core"
Expand Down Expand Up @@ -77,6 +78,7 @@ func TestHeartbeatSenderFactory_createHeartbeatSender(t *testing.T) {
}
hbSender, err := createHeartbeatSender(args)
assert.True(t, errors.Is(err, heartbeat.ErrInvalidConfiguration))
assert.True(t, strings.Contains(err.Error(), "isValidator"))
assert.True(t, check.IfNil(hbSender))
})
t.Run("validator should create regular sender", func(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion integrationTests/factory/componentsHelper.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func CreateDefaultConfig() *config.Configs {
configs.FlagsConfig = &config.ContextFlagsConfig{
WorkingDir: "workingDir",
UseLogView: true,
BaseVersion: fmt.Sprintf("%s-base", Version),
BaseVersion: BaseVersion,
Version: Version,
}
configs.ConfigurationPathsHolder = configPathsHolder
Expand Down
1 change: 1 addition & 0 deletions integrationTests/factory/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const (
GenesisPath = "../testdata/genesis.json"
GenesisSmartContracts = "../testdata/genesisSmartContracts.json"
ValidatorKeyPemPath = "../validatorKey.pem"
BaseVersion = "v1.1.6.1-0-gbae61225f/go1.14.2/linux-amd64"
Version = "v1.1.6.1-0-gbae61225f/go1.14.2/linux-amd64/a72b5f2eff"
WorkingDir = "workingDir"
RoundActivationPath = "enableRounds.toml"
Expand Down

0 comments on commit c52b27f

Please sign in to comment.