diff --git a/internal/configs/sharding/testnet.go b/internal/configs/sharding/testnet.go index ede03217e..261a77d0e 100644 --- a/internal/configs/sharding/testnet.go +++ b/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)