test(accounts): fix integration tests (#22418)
This commit is contained in:
@@ -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 (
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user