refactor!: deprecate blocktime on context (#17738)

This commit is contained in:
Marko
2023-09-18 13:55:21 +00:00
committed by GitHub
parent 8df065b611
commit 6615ff4f76
89 changed files with 379 additions and 369 deletions
+3 -3
View File
@@ -7,6 +7,7 @@ import (
"github.com/golang/mock/gomock"
"cosmossdk.io/collections"
"cosmossdk.io/core/header"
"cosmossdk.io/math"
"github.com/cosmos/cosmos-sdk/codec/address"
@@ -247,8 +248,7 @@ func (s *KeeperTestSuite) TestMsgEditValidator() {
s.execExpectCalls()
// create new context with updated block time
newCtx := ctx.WithBlockTime(ctx.BlockTime().AddDate(0, 0, 1))
newCtx := ctx.WithHeaderInfo(header.Info{Time: ctx.HeaderInfo().Time.AddDate(0, 0, 1)})
pk := ed25519.GenPrivKey().PubKey()
require.NotNil(pk)
@@ -852,7 +852,7 @@ func (s *KeeperTestSuite) TestMsgCancelUnbondingDelegation() {
require.NoError(err)
require.Equal(del, resDel)
ubd := stakingtypes.NewUnbondingDelegation(Addr, ValAddr, 10, ctx.BlockTime().Add(time.Minute*10), shares.RoundInt(), 0, keeper.ValidatorAddressCodec(), ak.AddressCodec())
ubd := stakingtypes.NewUnbondingDelegation(Addr, ValAddr, 10, ctx.HeaderInfo().Time.Add(time.Minute*10), shares.RoundInt(), 0, keeper.ValidatorAddressCodec(), ak.AddressCodec())
require.NoError(keeper.SetUnbondingDelegation(ctx, ubd))
resUnbond, err := keeper.GetUnbondingDelegation(ctx, Addr, ValAddr)
require.NoError(err)