Co-authored-by: Alexander Peters <alpe@users.noreply.github.com> Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
parent
090efc9f3b
commit
3fea483df8
@ -79,9 +79,9 @@ func GetRequestWithHeaders(t *testing.T, url string, headers map[string]string,
|
||||
defer func() {
|
||||
_ = res.Body.Close()
|
||||
}()
|
||||
require.Equal(t, expCode, res.StatusCode, "status code should be %d, got: %d", expCode, res.StatusCode)
|
||||
|
||||
body, err := io.ReadAll(res.Body)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, expCode, res.StatusCode, "status code should be %d, got: %d, %s", expCode, res.StatusCode, body)
|
||||
|
||||
return body
|
||||
}
|
||||
|
||||
@ -766,6 +766,11 @@ func (s *SystemUnderTest) CurrentHeight() int64 {
|
||||
return s.currentHeight.Load()
|
||||
}
|
||||
|
||||
// NodesCount returns the number of node instances used
|
||||
func (s *SystemUnderTest) NodesCount() int {
|
||||
return s.nodesCount
|
||||
}
|
||||
|
||||
type Node struct {
|
||||
ID string
|
||||
IP string
|
||||
|
||||
@ -51,6 +51,20 @@ func NewSingleHostTestnetCmdInitializer(
|
||||
}
|
||||
}
|
||||
|
||||
// InitializerWithBinary creates new SingleHostTestnetCmdInitializer from sut with given binary
|
||||
func InitializerWithBinary(binary string, sut *SystemUnderTest) TestnetInitializer {
|
||||
return NewSingleHostTestnetCmdInitializer(
|
||||
binary,
|
||||
WorkDir,
|
||||
sut.chainID,
|
||||
sut.outputDir,
|
||||
sut.initialNodesCount,
|
||||
sut.minGasPrice,
|
||||
sut.CommitTimeout(),
|
||||
sut.Log,
|
||||
)
|
||||
}
|
||||
|
||||
func (s SingleHostTestnetCmdInitializer) Initialize() {
|
||||
args := []string{
|
||||
"testnet",
|
||||
|
||||
@ -28,14 +28,14 @@ func TestChainUpgrade(t *testing.T) {
|
||||
currentBranchBinary := sut.execBinary
|
||||
currentInitializer := sut.testnetInitializer
|
||||
sut.SetExecBinary(legacyBinary)
|
||||
sut.SetTestnetInitializer(NewModifyConfigYamlInitializer(legacyBinary, sut))
|
||||
sut.SetTestnetInitializer(InitializerWithBinary(legacyBinary, sut))
|
||||
sut.SetupChain()
|
||||
votingPeriod := 5 * time.Second // enough time to vote
|
||||
sut.ModifyGenesisJSON(t, SetGovVotingPeriod(t, votingPeriod))
|
||||
|
||||
const (
|
||||
upgradeHeight int64 = 22
|
||||
upgradeName = "v050-to-v051"
|
||||
upgradeName = "v050-to-v052" // must match UpgradeName in simapp/upgrades.go
|
||||
)
|
||||
|
||||
sut.StartChain(t, fmt.Sprintf("--halt-height=%d", upgradeHeight+1))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user