Skip to content

Commit

Permalink
test: Allow to add new validator in test network (#193)
Browse files Browse the repository at this point in the history
  • Loading branch information
kukugi authored May 12, 2021
1 parent 0ee1980 commit f9fbaea
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions testutil/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,17 @@ func NewWithoutInit(t *testing.T, cfg Config, baseDir string, validators []*Vali
return network
}

func AddNewValidator(t *testing.T, network *Network, validator *Validator) {
t.Log("adding new validator")

require.NoError(t, startInProcess(network.Config, validator))
network.Validators = append(network.Validators, validator)

t.Log("added new validator")

server.TrapSignal(network.Cleanup)
}

// LatestHeight returns the latest height of the network or an error if the
// query fails or no validators exist.
func (n *Network) LatestHeight() (int64, error) {
Expand Down

0 comments on commit f9fbaea

Please sign in to comment.