test(accounts): fix integration tests (#22418)

This commit is contained in:
Akhil Kumar P
2024-11-11 15:12:15 +00:00
committed by GitHub
parent 370ee14df1
commit 78f08e8cac
7 changed files with 52 additions and 21 deletions
@@ -1,5 +1,3 @@
//go:build app_v1
package accounts
import (
@@ -15,12 +13,18 @@ import (
banktypes "cosmossdk.io/x/bank/types"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
"github.com/cosmos/cosmos-sdk/testutil/sims"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/stretchr/testify/require"
)
var (
privKey = secp256k1.GenPrivKey()
accCreator = []byte("creator")
)
func TestBaseAccount(t *testing.T) {
app := setupApp(t)
ak := app.AccountsKeeper
@@ -95,3 +99,16 @@ func toAnyPb(t *testing.T, pm gogoproto.Message) *codectypes.Any {
require.NoError(t, err)
return pb
}
func coins(t *testing.T, s string) sdk.Coins {
t.Helper()
coins, err := sdk.ParseCoinsNormalized(s)
require.NoError(t, err)
return coins
}
func setupApp(t *testing.T) *simapp.SimApp {
t.Helper()
app := simapp.Setup(t, false)
return app
}
@@ -1,5 +1,3 @@
//go:build app_v1
package accounts
import (
+1 -1
View File
@@ -172,7 +172,7 @@ func TestBaseApp_BlockGas(t *testing.T) {
require.Equal(t, []byte("ok"), okValue)
}
// check block gas is always consumed
baseGas := uint64(38142) // baseGas is the gas consumed before tx msg
baseGas := uint64(39205) // baseGas is the gas consumed before tx msg
expGasConsumed := addUint64Saturating(tc.gasToConsume, baseGas)
if expGasConsumed > uint64(simtestutil.DefaultConsensusParams.Block.MaxGas) {
// capped by gasLimit