github.com/cosmos/cosmos-sdk@v0.50.10/x/auth/tx/config_test.go (about)

     1  package tx_test
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/stretchr/testify/require"
     7  	"github.com/stretchr/testify/suite"
     8  
     9  	"github.com/cosmos/cosmos-sdk/codec"
    10  	"github.com/cosmos/cosmos-sdk/codec/testutil"
    11  	"github.com/cosmos/cosmos-sdk/codec/types"
    12  	"github.com/cosmos/cosmos-sdk/std"
    13  	"github.com/cosmos/cosmos-sdk/testutil/testdata"
    14  	sdk "github.com/cosmos/cosmos-sdk/types"
    15  	"github.com/cosmos/cosmos-sdk/x/auth/tx"
    16  	txtestutil "github.com/cosmos/cosmos-sdk/x/auth/tx/testutil"
    17  )
    18  
    19  func TestGenerator(t *testing.T) {
    20  	interfaceRegistry := testutil.CodecOptions{}.NewInterfaceRegistry()
    21  	std.RegisterInterfaces(interfaceRegistry)
    22  	interfaceRegistry.RegisterImplementations((*sdk.Msg)(nil), &testdata.TestMsg{})
    23  	protoCodec := codec.NewProtoCodec(interfaceRegistry)
    24  	suite.Run(t, txtestutil.NewTxConfigTestSuite(tx.NewTxConfig(protoCodec, tx.DefaultSignModes)))
    25  }
    26  
    27  func TestConfigOptions(t *testing.T) {
    28  	interfaceRegistry := types.NewInterfaceRegistry()
    29  	protoCodec := codec.NewProtoCodec(interfaceRegistry)
    30  	configOptions := tx.ConfigOptions{}
    31  	txConfig, err := tx.NewTxConfigWithOptions(protoCodec, configOptions)
    32  	require.NoError(t, err)
    33  	require.NotNil(t, txConfig)
    34  	handler := txConfig.SignModeHandler()
    35  	require.NotNil(t, handler)
    36  }