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 -2
View File
@@ -6,6 +6,7 @@ import (
"github.com/golang/mock/gomock"
"github.com/stretchr/testify/require"
"cosmossdk.io/core/header"
sdkmath "cosmossdk.io/math"
storetypes "cosmossdk.io/store/types"
"cosmossdk.io/x/feegrant"
@@ -34,7 +35,7 @@ func TestFeegrantPruning(t *testing.T) {
granter3 := addrs[2]
grantee := addrs[3]
spendLimit := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(1000)))
now := testCtx.Ctx.BlockTime()
now := testCtx.Ctx.HeaderInfo().Time
oneDay := now.AddDate(0, 0, 1)
ctrl := gomock.NewController(t)
@@ -91,7 +92,7 @@ func TestFeegrantPruning(t *testing.T) {
require.NotNil(t, res)
require.Len(t, res.Allowances, 2)
testCtx.Ctx = testCtx.Ctx.WithBlockTime(now.AddDate(0, 0, 2))
testCtx.Ctx = testCtx.Ctx.WithHeaderInfo(header.Info{Time: now.AddDate(0, 0, 2)})
module.EndBlocker(testCtx.Ctx, feegrantKeeper)
res, err = queryClient.Allowances(testCtx.Ctx.Context(), &feegrant.QueryAllowancesRequest{