Skip to content

Commit

Permalink
update: change test package name
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianToledano committed Nov 16, 2023
1 parent 7217fba commit 8d3e693
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 17 deletions.
7 changes: 3 additions & 4 deletions client/tx/aux_builder_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package tx_test
package tx

import (
"testing"

"github.com/stretchr/testify/require"

"github.com/cosmos/cosmos-sdk/client/tx"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
Expand All @@ -26,7 +25,7 @@ func TestAuxTxBuilder(t *testing.T) {
// required for test case: "GetAuxSignerData works for DIRECT_AUX"
counterModule.RegisterInterfaces(reg)

var b tx.AuxTxBuilder
var b AuxTxBuilder

testcases := []struct {
name string
Expand Down Expand Up @@ -200,7 +199,7 @@ func TestAuxTxBuilder(t *testing.T) {
for _, tc := range testcases {
tc := tc
t.Run(tc.name, func(t *testing.T) {
b = tx.NewAuxTxBuilder()
b = NewAuxTxBuilder()
err := tc.malleate()

if tc.expErr {
Expand Down
2 changes: 1 addition & 1 deletion client/tx/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/cosmos/cosmos-sdk/types/tx/signing"
)

func TestFactoryPrepate(t *testing.T) {
func TestFactoryPrepare(t *testing.T) {
t.Parallel()

factory := Factory{}
Expand Down
2 changes: 1 addition & 1 deletion client/tx/legacy_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tx_test
package tx

import (
"github.com/cosmos/cosmos-sdk/testutil/testdata"
Expand Down
21 changes: 10 additions & 11 deletions client/tx/tx_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tx_test
package tx

import (
"context"
Expand All @@ -9,12 +9,11 @@ import (
"github.com/stretchr/testify/require"
"google.golang.org/grpc"

ante "cosmossdk.io/x/auth/ante"
"cosmossdk.io/x/auth/ante"
"cosmossdk.io/x/auth/signing"
authtx "cosmossdk.io/x/auth/tx"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/tx"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/crypto/hd"
Expand Down Expand Up @@ -81,7 +80,7 @@ func TestCalculateGas(t *testing.T) {
defaultSignMode, err := signing.APISignModeToInternal(txCfg.SignModeHandler().DefaultMode())
require.NoError(t, err)

txf := tx.Factory{}.
txf := Factory{}.
WithChainID("test-chain").
WithTxConfig(txCfg).WithSignMode(defaultSignMode)

Expand All @@ -90,7 +89,7 @@ func TestCalculateGas(t *testing.T) {
gasUsed: tc.args.mockGasUsed,
wantErr: tc.args.mockWantErr,
}
simRes, gotAdjusted, err := tx.CalculateGas(mockClientCtx, txf.WithGasAdjustment(stc.args.adjustment))
simRes, gotAdjusted, err := CalculateGas(mockClientCtx, txf.WithGasAdjustment(stc.args.adjustment))
if stc.expPass {
require.NoError(t, err)
require.Equal(t, simRes.GasInfo.GasUsed, stc.wantEstimate)
Expand All @@ -104,8 +103,8 @@ func TestCalculateGas(t *testing.T) {
}
}

func mockTxFactory(txCfg client.TxConfig) tx.Factory {
return tx.Factory{}.
func mockTxFactory(txCfg client.TxConfig) Factory {
return Factory{}.
WithTxConfig(txCfg).
WithAccountNumber(50).
WithSequence(23).
Expand Down Expand Up @@ -196,7 +195,7 @@ func TestMnemonicInMemo(t *testing.T) {

for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
txf := tx.Factory{}.
txf := Factory{}.
WithTxConfig(txConfig).
WithAccountNumber(50).
WithSequence(23).
Expand Down Expand Up @@ -267,7 +266,7 @@ func TestSign(t *testing.T) {

testCases := []struct {
name string
txf tx.Factory
txf Factory
txb client.TxBuilder
from string
overwrite bool
Expand Down Expand Up @@ -354,7 +353,7 @@ func TestSign(t *testing.T) {
var prevSigs []signingtypes.SignatureV2
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
err = tx.Sign(context.TODO(), tc.txf, tc.from, tc.txb, tc.overwrite)
err = Sign(context.TODO(), tc.txf, tc.from, tc.txb, tc.overwrite)
if len(tc.expectedPKs) == 0 {
requireT.Error(err)
} else {
Expand Down Expand Up @@ -409,7 +408,7 @@ func TestPreprocessHook(t *testing.T) {
txb, err := txfDirect.BuildUnsignedTx(msg1, msg2)
requireT.NoError(err)

err = tx.Sign(context.TODO(), txfDirect, from, txb, false)
err = Sign(context.TODO(), txfDirect, from, txb, false)
requireT.NoError(err)

// Run preprocessing
Expand Down

0 comments on commit 8d3e693

Please sign in to comment.