Skip to content

Commit

Permalink
enabling features at Upernavik height
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinxie committed Jun 20, 2024
1 parent f001407 commit 826a7c3
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
14 changes: 7 additions & 7 deletions action/protocol/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,13 @@ func WithFeatureCtx(ctx context.Context) context.Context {
CandidateRegisterMustWithStake: !g.IsTsunami(height),
DisableDelegateEndorsement: !g.IsTsunami(height),
RefactorFreshAccountConversion: g.IsTsunami(height),
SuicideTxLogMismatchPanic: g.IsToBeEnabled(height),
PanicUnrecoverableError: g.IsToBeEnabled(height),
CandidateIdentifiedByOwner: !g.IsToBeEnabled(height),
UseTxContainer: g.IsToBeEnabled(height),
LimitedStakingContract: !g.IsToBeEnabled(height),
MigrateNativeStake: g.IsToBeEnabled(height),
AddClaimRewardAddress: g.IsToBeEnabled(height),
SuicideTxLogMismatchPanic: g.IsUpernavik(height),
PanicUnrecoverableError: g.IsUpernavik(height),
CandidateIdentifiedByOwner: !g.IsUpernavik(height),
UseTxContainer: g.IsUpernavik(height),
LimitedStakingContract: !g.IsUpernavik(height),
MigrateNativeStake: g.IsUpernavik(height),
AddClaimRewardAddress: g.IsUpernavik(height),
},
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ func TestProtocol_HandleCandidateTransferOwnership(t *testing.T) {
})
cfg := deepcopy.Copy(genesis.Default).(genesis.Genesis)
cfg.TsunamiBlockHeight = 1
cfg.ToBeEnabledBlockHeight = 1 // enable candidate owner transfer feature
cfg.UpernavikBlockHeight = 1 // enable candidate owner transfer feature
ctx = genesis.WithGenesisContext(ctx, cfg)
ctx = protocol.WithFeatureCtx(protocol.WithFeatureWithHeightCtx(ctx))
require.NoError(p.Validate(ctx, act, sm))
Expand Down
3 changes: 1 addition & 2 deletions action/protocol/staking/handler_stake_migrate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ func TestHandleStakeMigrate(t *testing.T) {
cfg.RedseaBlockHeight = 1
cfg.SumatraBlockHeight = 1
cfg.TsunamiBlockHeight = 1
cfg.UpernavikBlockHeight = 1000000 // not enabled
cfg.ToBeEnabledBlockHeight = 1 // enable CandidateIdentifiedByOwner feature
cfg.UpernavikBlockHeight = 2 // enable CandidateIdentifiedByOwner feature
}
initCfg(&cfg)

Expand Down
2 changes: 1 addition & 1 deletion blockchain/integrity/integrity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@ func TestBlockchainHardForkFeatures(t *testing.T) {
cfg.Genesis.RedseaBlockHeight = 2
cfg.Genesis.SumatraBlockHeight = 2
cfg.Genesis.TsunamiBlockHeight = 3
cfg.Genesis.ToBeEnabledBlockHeight = 3
cfg.Genesis.UpernavikBlockHeight = 4
cfg.Genesis.InitBalanceMap[identityset.Address(27).String()] = unit.ConvertIotxToRau(10000000000).String()

ctx := context.Background()
Expand Down
5 changes: 2 additions & 3 deletions e2etest/native_staking_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ func TestNativeStaking(t *testing.T) {
cfg.Genesis.FbkMigrationBlockHeight = 1
cfg.Genesis.TsunamiBlockHeight = 2
cfg.Genesis.EndorsementWithdrawWaitingBlocks = 10
cfg.Genesis.ToBeEnabledBlockHeight = 3 // enable CandidateIdentifiedByOwner feature
cfg.Genesis.UpernavikBlockHeight = 3 // enable CandidateIdentifiedByOwner feature

t.Run("test native staking", func(t *testing.T) {
testNativeStaking(cfg, t)
Expand Down Expand Up @@ -629,8 +629,7 @@ func TestCandidateTransferOwnership(t *testing.T) {
cfg.Genesis.RedseaBlockHeight = 1
cfg.Genesis.SumatraBlockHeight = 1
cfg.Genesis.TsunamiBlockHeight = 1
cfg.Genesis.UpernavikBlockHeight = 1000000 // not enabled
cfg.Genesis.ToBeEnabledBlockHeight = 1 // enable CandidateIdentifiedByOwner feature
cfg.Genesis.UpernavikBlockHeight = 2 // enable CandidateIdentifiedByOwner feature
return cfg
}
registerAmount, _ := big.NewInt(0).SetString("1200000000000000000000000", 10)
Expand Down

0 comments on commit 826a7c3

Please sign in to comment.