Skip to content

Commit

Permalink
chg: solve some TODOs / fix some tests and provide context for skippe…
Browse files Browse the repository at this point in the history
…d tests
  • Loading branch information
marcello33 committed Jan 29, 2024
1 parent a34d0f9 commit 7a803b3
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 27 deletions.
6 changes: 3 additions & 3 deletions x/auth/ante/ante_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ func TestAnteHandlerFees(t *testing.T) {

// Test logic around memo gas consumption.
func TestAnteHandlerMemoGas(t *testing.T) {
t.Skip("skipping test as not relevant to Heimdall")
t.Skip("skipping test as not relevant to Heimdall (no memo)")
testCases := []TestCase{
{
"tx does not have enough gas",
Expand Down Expand Up @@ -733,7 +733,7 @@ func TestAnteHandlerMemoGas(t *testing.T) {
}

func TestAnteHandlerMultiSigner(t *testing.T) {
t.Skip("skipping test as not relevant to Heimdall")
t.Skip("skipping test as not relevant to Heimdall (no multisign)")
feeAmount := testdata.NewTestFeeAmount()
gasLimit := testdata.NewTestGasLimit()

Expand Down Expand Up @@ -1385,7 +1385,7 @@ func TestCustomSignatureVerificationGasConsumer(t *testing.T) {
}

func TestAnteHandlerReCheck(t *testing.T) {
t.Skip() // TODO HV2: This test is currently broken. To be fixed?
t.Skip("skipping test as not relevant to Heimdall (no checkTx)")
suite := SetupTestSuite(t, false)
// Set recheck=true
suite.ctx = suite.ctx.WithIsReCheckTx(true)
Expand Down
8 changes: 4 additions & 4 deletions x/auth/ante/basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
)

func TestValidateBasic(t *testing.T) {
suite := SetupTestSuite(t, true)
suite := SetupTestSuite(t, false)
suite.txBuilder = suite.clientCtx.TxConfig.NewTxBuilder()

// keys and addresses
Expand Down Expand Up @@ -59,7 +59,7 @@ func TestValidateBasic(t *testing.T) {
}

func TestValidateMemo(t *testing.T) {
suite := SetupTestSuite(t, true)
suite := SetupTestSuite(t, false)
suite.txBuilder = suite.clientCtx.TxConfig.NewTxBuilder()

// keys and addresses
Expand Down Expand Up @@ -95,7 +95,7 @@ func TestValidateMemo(t *testing.T) {
}

func TestConsumeGasForTxSize(t *testing.T) {
suite := SetupTestSuite(t, true)
suite := SetupTestSuite(t, false)

// keys and addresses
priv1, _, addr1 := testdata.KeyTestPubAddr()
Expand Down Expand Up @@ -179,7 +179,7 @@ func TestConsumeGasForTxSize(t *testing.T) {
}

func TestTxHeightTimeoutDecorator(t *testing.T) {
suite := SetupTestSuite(t, true)
suite := SetupTestSuite(t, false)

antehandler := sdk.ChainAnteDecorators(ante.NewTxTimeoutHeightDecorator())

Expand Down
2 changes: 1 addition & 1 deletion x/auth/ante/ext_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
)

func TestRejectExtensionOptionsDecorator(t *testing.T) {
suite := SetupTestSuite(t, true)
suite := SetupTestSuite(t, false)

testCases := []struct {
msg string
Expand Down
4 changes: 2 additions & 2 deletions x/auth/ante/fee_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
)

func TestDeductFeeDecorator_ZeroGas(t *testing.T) {
s := SetupTestSuite(t, true)
s := SetupTestSuite(t, false)
s.txBuilder = s.clientCtx.TxConfig.NewTxBuilder()

mfd := ante.NewDeductFeeDecorator(s.accountKeeper, s.bankKeeper, s.feeGrantKeeper, nil)
Expand Down Expand Up @@ -50,7 +50,7 @@ func TestDeductFeeDecorator_ZeroGas(t *testing.T) {
}

func TestEnsureMempoolFees(t *testing.T) {
t.Skip() // TODO HV2: skipped as we use a different fee model. To be fixed?
t.Skip("skipping test as not relevant to Heimdall (no checkTx")
s := SetupTestSuite(t, true) // setup
s.txBuilder = s.clientCtx.TxConfig.NewTxBuilder()

Expand Down
6 changes: 3 additions & 3 deletions x/auth/ante/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
)

func TestSetupDecorator_BlockMaxGas(t *testing.T) {
suite := SetupTestSuite(t, true)
suite := SetupTestSuite(t, false)
suite.txBuilder = suite.clientCtx.TxConfig.NewTxBuilder()

// keys and addresses
Expand Down Expand Up @@ -51,7 +51,7 @@ func TestSetupDecorator_BlockMaxGas(t *testing.T) {
}

func TestSetup(t *testing.T) {
suite := SetupTestSuite(t, true)
suite := SetupTestSuite(t, false)
suite.txBuilder = suite.clientCtx.TxConfig.NewTxBuilder()

// keys and addresses
Expand Down Expand Up @@ -86,7 +86,7 @@ func TestSetup(t *testing.T) {
}

func TestRecoverPanic(t *testing.T) {
suite := SetupTestSuite(t, true)
suite := SetupTestSuite(t, false)
suite.txBuilder = suite.clientCtx.TxConfig.NewTxBuilder()

// keys and addresses
Expand Down
10 changes: 5 additions & 5 deletions x/auth/ante/sigverify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
)

func TestSetPubKey(t *testing.T) {
suite := SetupTestSuite(t, true)
suite := SetupTestSuite(t, false)
suite.txBuilder = suite.clientCtx.TxConfig.NewTxBuilder()

// keys and addresses
Expand Down Expand Up @@ -71,7 +71,7 @@ func TestSetPubKey(t *testing.T) {
}

func TestConsumeSignatureVerificationGas(t *testing.T) {
suite := SetupTestSuite(t, true)
suite := SetupTestSuite(t, false)
params := types.DefaultParams()
msg := []byte{1, 2, 3, 4}

Expand Down Expand Up @@ -125,7 +125,7 @@ func TestConsumeSignatureVerificationGas(t *testing.T) {
}

func TestSigVerification(t *testing.T) {
suite := SetupTestSuite(t, true)
suite := SetupTestSuite(t, false)
suite.txBankKeeper.EXPECT().DenomMetadata(gomock.Any(), gomock.Any()).Return(&banktypes.QueryDenomMetadataResponse{}, nil).AnyTimes()

enabledSignModes := []signing.SignMode{signing.SignMode_SIGN_MODE_DIRECT, signing.SignMode_SIGN_MODE_TEXTUAL, signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON}
Expand Down Expand Up @@ -262,7 +262,7 @@ func TestSigIntegration(t *testing.T) {
}

func runSigDecorators(t *testing.T, params types.Params, _ bool, privs ...cryptotypes.PrivKey) (storetypes.Gas, error) {
suite := SetupTestSuite(t, true)
suite := SetupTestSuite(t, false)
suite.txBuilder = suite.clientCtx.TxConfig.NewTxBuilder()

// Make block-height non-zero to include accNum in SignBytes
Expand Down Expand Up @@ -311,7 +311,7 @@ func runSigDecorators(t *testing.T, params types.Params, _ bool, privs ...crypto
}

func TestIncrementSequenceDecorator(t *testing.T) {
suite := SetupTestSuite(t, true)
suite := SetupTestSuite(t, false)
suite.txBuilder = suite.clientCtx.TxConfig.NewTxBuilder()

priv, _, addr := testdata.KeyTestPubAddr()
Expand Down
2 changes: 0 additions & 2 deletions x/auth/keeper/deterministic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ func pubkeyGenerator(t *rapid.T) *rapid.Generator[secp256k1.PubKey] {
}

func (suite *DeterministicTestSuite) TestGRPCQueryAccounts() {
suite.T().Skip()
rapid.Check(suite.T(), func(t *rapid.T) {
numAccs := rapid.IntRange(1, 10).Draw(t, "accounts")
accs := suite.createAndSetAccounts(t, numAccs)
Expand Down Expand Up @@ -198,7 +197,6 @@ func (suite *DeterministicTestSuite) TestGRPCQueryAccountAddressByID() {
}

func (suite *DeterministicTestSuite) TestGRPCQueryParameters() {
// suite.T().Skip() // TODO HV2: skipped as we use a different fee model. To be fixed?
rapid.Check(suite.T(), func(t *rapid.T) {
params := types.NewParams(
rapid.Uint64Min(1).Draw(t, "max-memo-characters"),
Expand Down
2 changes: 1 addition & 1 deletion x/auth/migrations/v2/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (ms mockSubspace) GetParamSet(ctx sdk.Context, ps authexported.ParamSet) {
}

func TestMigrateVestingAccounts(t *testing.T) {
t.Skip() // TODO HV2: skipped as it uses depinject. Shall we enable it and unskip this test?
t.Skip("skipping test as not relevant to Heimdall (no depinject)") // TODO HV2: setup app without depinject and enable it?
encCfg := moduletestutil.MakeTestEncodingConfig(auth.AppModuleBasic{})
cdc := encCfg.Codec

Expand Down
2 changes: 1 addition & 1 deletion x/auth/migrations/v3/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (ms mockSubspace) GetParamSet(ctx sdk.Context, ps authexported.ParamSet) {

// TestMigrateMapAccAddressToAccNumberKey test cases for state migration of map to accAddr to accNum
func TestMigrateMapAccAddressToAccNumberKey(t *testing.T) {
t.Skip() // TODO HV2: skipped as it uses depinject. Shall we enable it and unskip this test?
t.Skip("skipping test as not relevant to Heimdall (no depinject)") // TODO HV2: setup app without depinject and enable it?
encCfg := moduletestutil.MakeTestEncodingConfig(auth.AppModuleBasic{})
cdc := encCfg.Codec

Expand Down
2 changes: 1 addition & 1 deletion x/auth/module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

func TestItCreatesModuleAccountOnInitBlock(t *testing.T) {
t.Skip() // skipping as we are not using depinject
t.Skip("skipping test as not relevant to Heimdall (no depinject)") // TODO HV2: setup app without depinject and enable it?
var accountKeeper keeper.AccountKeeper
app, err := simtestutil.SetupAtGenesis(
depinject.Configs(
Expand Down
2 changes: 1 addition & 1 deletion x/auth/types/account_retriever_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

func TestAccountRetriever(t *testing.T) {
t.Skip() // TODO HV2: skipped as it uses depinject. Shall we enable it and unskip this test?
t.Skip("skipping test as not relevant to Heimdall (no depinject)") // TODO HV2: setup app without depinject and enable it?
cfg, err := network.DefaultConfigWithAppConfig(testutil.AppConfig)
require.NoError(t, err)
cfg.NumValidators = 1
Expand Down
6 changes: 3 additions & 3 deletions x/auth/vesting/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (s *VestingTestSuite) SetupTest() {
}

func (s *VestingTestSuite) TestCreateVestingAccount() {
s.T().Skip() // skipped as not using vesting accounts
s.T().Skip("skipping test as not relevant to Heimdall (no vesting)")
testCases := map[string]struct {
preRun func()
input *vestingtypes.MsgCreateVestingAccount
Expand Down Expand Up @@ -187,7 +187,7 @@ func (s *VestingTestSuite) TestCreateVestingAccount() {
}

func (s *VestingTestSuite) TestCreatePermanentLockedAccount() {
s.T().Skip() // skipped as not using vesting accounts
s.T().Skip("skipping test as not relevant to Heimdall (no vesting)")
testCases := map[string]struct {
preRun func()
input *vestingtypes.MsgCreatePermanentLockedAccount
Expand Down Expand Up @@ -270,7 +270,7 @@ func (s *VestingTestSuite) TestCreatePermanentLockedAccount() {
}

func (s *VestingTestSuite) TestCreatePeriodicVestingAccount() {
s.T().Skip() // skipped as not using vesting accounts
s.T().Skip("skipping test as not relevant to Heimdall (no vesting)")
testCases := []struct {
name string
preRun func()
Expand Down

0 comments on commit 7a803b3

Please sign in to comment.