diff --git a/action/protocol/staking/handler_stake_migrate.go b/action/protocol/staking/handler_stake_migrate.go index e1d4d5c367..375138ee7f 100644 --- a/action/protocol/staking/handler_stake_migrate.go +++ b/action/protocol/staking/handler_stake_migrate.go @@ -61,7 +61,7 @@ func (p *Protocol) handleStakeMigrate(ctx context.Context, act *action.MigrateSt transferLogs = append(transferLogs, tLog) // call staking contract to stake - duration := uint64(bucket.StakedDuration / p.helperCtx.GetBlockInterval(protocol.MustGetBlockCtx(ctx).BlockHeight)) + duration := uint64(bucket.StakedDuration / p.helperCtx.BlockInterval(protocol.MustGetBlockCtx(ctx).BlockHeight)) exec, err := p.constructExecution(candidate.GetIdentifier(), bucket.StakedAmount, duration, act.Nonce(), act.GasLimit(), act.GasPrice()) if err != nil { revertSM() @@ -167,7 +167,7 @@ func (p *Protocol) ConstructExecution(ctx context.Context, act *action.MigrateSt if candidate == nil { return nil, errCandNotExist } - duration := uint64(bucket.StakedDuration / p.helperCtx.GetBlockInterval(protocol.MustGetBlockCtx(ctx).BlockHeight)) + duration := uint64(bucket.StakedDuration / p.helperCtx.BlockInterval(protocol.MustGetBlockCtx(ctx).BlockHeight)) return p.constructExecution(candidate.GetIdentifier(), bucket.StakedAmount, duration, act.Nonce(), act.GasLimit(), act.GasPrice()) } diff --git a/e2etest/native_staking_test.go b/e2etest/native_staking_test.go index 2704b2cb2f..b6bfead455 100644 --- a/e2etest/native_staking_test.go +++ b/e2etest/native_staking_test.go @@ -828,8 +828,8 @@ func TestCandidateTransferOwnership(t *testing.T) { t.Run("migrate stake", func(t *testing.T) { contractAddress := "io1dkqh5mu9djfas3xyrmzdv9frsmmytel4mp7a64" cfg := initCfg() - cfg.Genesis.SystemStakingContractAddressV2 = contractAddress - cfg.Genesis.SystemStakingContractHeightV2 = 1 + cfg.Genesis.SystemStakingContractV2Address = contractAddress + cfg.Genesis.SystemStakingContractV2Height = 1 cfg.DardanellesUpgrade.BlockInterval = time.Second * 8640 test := newE2ETest(t, cfg) defer test.teardown()