mirror of
https://github.com/tendermint/tendermint.git
synced 2026-08-18 13:16:25 +00:00
libs/common: refactor libs/common 2 (#4231)
* libs/common: refactor libs/common 2 - move random function to there own pkg Signed-off-by: Marko Baricevic <marbar3778@yahoo.com> * change imports and usage throughout repo * fix goimports * add changelog entry
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
cfg "github.com/tendermint/tendermint/config"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
"github.com/tendermint/tendermint/libs/rand"
|
||||
"github.com/tendermint/tendermint/p2p"
|
||||
"github.com/tendermint/tendermint/privval"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
@@ -55,7 +56,7 @@ func initFilesWithConfig(config *cfg.Config) error {
|
||||
logger.Info("Found genesis file", "path", genFile)
|
||||
} else {
|
||||
genDoc := types.GenesisDoc{
|
||||
ChainID: fmt.Sprintf("test-chain-%v", cmn.RandStr(6)),
|
||||
ChainID: fmt.Sprintf("test-chain-%v", rand.RandStr(6)),
|
||||
GenesisTime: tmtime.Now(),
|
||||
ConsensusParams: types.DefaultConsensusParams(),
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import (
|
||||
|
||||
cfg "github.com/tendermint/tendermint/config"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
"github.com/tendermint/tendermint/libs/rand"
|
||||
"github.com/tendermint/tendermint/p2p"
|
||||
"github.com/tendermint/tendermint/privval"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
@@ -167,7 +168,7 @@ func testnetFiles(cmd *cobra.Command, args []string) error {
|
||||
|
||||
// Generate genesis doc from generated validators
|
||||
genDoc := &types.GenesisDoc{
|
||||
ChainID: "chain-" + cmn.RandStr(6),
|
||||
ChainID: "chain-" + rand.RandStr(6),
|
||||
ConsensusParams: types.DefaultConsensusParams(),
|
||||
GenesisTime: tmtime.Now(),
|
||||
Validators: genVals,
|
||||
@@ -261,5 +262,5 @@ func moniker(i int) string {
|
||||
}
|
||||
|
||||
func randomMoniker() string {
|
||||
return cmn.HexBytes(cmn.RandBytes(8)).String()
|
||||
return cmn.HexBytes(rand.RandBytes(8)).String()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user