Skip to content

Commit

Permalink
Merge branch 'main' into bez/skip-store-v1-proto-gen
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderbez authored Oct 23, 2023
2 parents 83dc679 + c1f050f commit 2025bb5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
13 changes: 7 additions & 6 deletions testutil/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ type Config struct {
AccountRetriever client.AccountRetriever
AppConstructor AppConstructor // the ABCI application constructor
GenesisState map[string]json.RawMessage // custom genesis state to provide
GenesisTime time.Time // the genesis time
TimeoutCommit time.Duration // the consensus commitment timeout
ChainID string // the network chain-id
NumValidators int // the total number of validators to create and bond
Expand Down Expand Up @@ -477,7 +478,12 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) {
cmtCfg.P2P.AddrBookStrict = false
cmtCfg.P2P.AllowDuplicateIP = true

nodeID, pubKey, err := genutil.InitializeNodeValidatorFiles(cmtCfg)
var mnemonic string
if i < len(cfg.Mnemonics) {
mnemonic = cfg.Mnemonics[i]
}

nodeID, pubKey, err := genutil.InitializeNodeValidatorFilesFromMnemonic(cmtCfg, mnemonic)
if err != nil {
return nil, err
}
Expand All @@ -496,11 +502,6 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) {
return nil, err
}

var mnemonic string
if i < len(cfg.Mnemonics) {
mnemonic = cfg.Mnemonics[i]
}

addr, secret, err := testutil.GenerateSaveCoinKey(kb, nodeDirName, mnemonic, true, algo)
if err != nil {
return nil, err
Expand Down
5 changes: 4 additions & 1 deletion testutil/network/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,10 @@ func startInProcess(cfg Config, val *Validator) error {
}

func collectGenFiles(cfg Config, vals []*Validator, outputDir string) error {
genTime := cmttime.Now()
genTime := cfg.GenesisTime
if genTime.IsZero() {
genTime = cmttime.Now()
}

for i := 0; i < cfg.NumValidators; i++ {
cmtCfg := vals[i].Ctx.Config
Expand Down

0 comments on commit 2025bb5

Please sign in to comment.