[test] add resharding in testnet

Signed-off-by: Leo Chen <leo@harmony.one>
pull/1231/head
Leo Chen 5 years ago
parent 31c686ddb5
commit 660faeaf18
  1. 16
      internal/configs/sharding/testnet.go

@ -12,8 +12,17 @@ var TestnetSchedule testnetSchedule
type testnetSchedule struct{}
const (
testnetV1Epoch = 1
testnetV2Epoch = 2
)
func (testnetSchedule) InstanceForEpoch(epoch *big.Int) Instance {
switch {
case epoch.Cmp(big.NewInt(testnetV2Epoch)) >= 0:
return testnetV2
case epoch.Cmp(big.NewInt(testnetV1Epoch)) >= 0:
return testnetV1
default: // genesis
return testnetV0
}
@ -24,5 +33,8 @@ func (testnetSchedule) BlocksPerEpoch() uint64 {
return 10800
}
var testnetReshardingEpoch = make([]*big.Int, 0)
var testnetV0 = MustNewInstance(2, 150, 150, genesis.TNHarmonyAccounts, genesis.FoundationalNodeAccounts, testnetReshardingEpoch)
var testnetReshardingEpoch = []*big.Int{big.NewInt(0), big.NewInt(testnetV1Epoch), big.NewInt(testnetV2Epoch)}
var testnetV0 = MustNewInstance(2, 150, 150, genesis.TNHarmonyAccounts, genesis.TNFoundationalAccounts, testnetReshardingEpoch)
var testnetV1 = MustNewInstance(2, 160, 150, genesis.TNHarmonyAccounts, genesis.TNFoundationalAccounts, testnetReshardingEpoch)
var testnetV2 = MustNewInstance(2, 170, 150, genesis.TNHarmonyAccounts, genesis.TNFoundationalAccounts, testnetReshardingEpoch)

Loading…
Cancel
Save