diff --git a/x/assets/transactions/deputize/message.go b/x/assets/transactions/deputize/message.go index 91e7ebd6e..4e664c65e 100644 --- a/x/assets/transactions/deputize/message.go +++ b/x/assets/transactions/deputize/message.go @@ -9,7 +9,7 @@ import ( baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists" baseLists "github.com/AssetMantle/schema/lists/base" - "github.com/cosmos/cosmos-sdk/codec" + sdkCodec "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" @@ -51,7 +51,7 @@ func (message *Message) GetSigners() []sdkTypes.AccAddress { } return []sdkTypes.AccAddress{from} } -func (*Message) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { +func (*Message) RegisterLegacyAminoCodec(legacyAmino *sdkCodec.LegacyAmino) { codecUtilities.RegisterModuleConcrete(legacyAmino, Message{}) } func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry) { diff --git a/x/assets/transactions/deputize/message_test.go b/x/assets/transactions/deputize/message_test.go index 9eaf68fd9..420554cba 100644 --- a/x/assets/transactions/deputize/message_test.go +++ b/x/assets/transactions/deputize/message_test.go @@ -14,7 +14,7 @@ import ( baseLists "github.com/AssetMantle/schema/lists/base" baseProperties "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" + sdkCodec "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/AssetMantle/modules/helpers" @@ -114,15 +114,15 @@ func Test_message_GetSigners(t *testing.T) { func Test_message_RegisterCodec(t *testing.T) { type args struct { - legacyAmino *codec.LegacyAmino + legacyAmino *sdkCodec.LegacyAmino } tests := []struct { name string fields fields args args }{ - {"+ve with nil", fields{}, args{codec.NewLegacyAmino()}}, - {"+ve", fields{fromAccAddress.String(), fromID, fromID, classificationID, mutableMetaProperties, true, true, true, true, true, true}, args{codec.NewLegacyAmino()}}, + {"+ve with nil", fields{}, args{sdkCodec.NewLegacyAmino()}}, + {"+ve", fields{fromAccAddress.String(), fromID, fromID, classificationID, mutableMetaProperties, true, true, true, true, true, true}, args{sdkCodec.NewLegacyAmino()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/assets/transactions/deputize/transaction_keeper_test.go b/x/assets/transactions/deputize/transaction_keeper_test.go index 202c608e7..68bb612b6 100644 --- a/x/assets/transactions/deputize/transaction_keeper_test.go +++ b/x/assets/transactions/deputize/transaction_keeper_test.go @@ -5,180 +5,256 @@ package deputize import ( "context" - "fmt" - "github.com/AssetMantle/modules/x/assets/record" - storeTypes "github.com/cosmos/cosmos-sdk/store/types" - "reflect" - "testing" - + baseHelpers "github.com/AssetMantle/modules/helpers/base" + errorConstants "github.com/AssetMantle/modules/helpers/constants" + "github.com/AssetMantle/modules/x/assets/constants" + "github.com/AssetMantle/modules/x/assets/mapper" + "github.com/AssetMantle/modules/x/assets/parameters" + permissionHelper "github.com/AssetMantle/modules/x/assets/utilities" + "github.com/AssetMantle/modules/x/identities/auxiliaries/authenticate" + "github.com/AssetMantle/modules/x/maintainers/auxiliaries/deputize" baseData "github.com/AssetMantle/schema/data/base" - "github.com/AssetMantle/schema/documents/base" + "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" baseLists "github.com/AssetMantle/schema/lists/base" + "github.com/AssetMantle/schema/parameters/base" baseProperties "github.com/AssetMantle/schema/properties/base" - baseQualified "github.com/AssetMantle/schema/qualified/base" + constantProperties "github.com/AssetMantle/schema/properties/constants" tendermintDB "github.com/cometbft/cometbft-db" + "github.com/cometbft/cometbft/crypto/ed25519" "github.com/cometbft/cometbft/libs/log" protoTendermintTypes "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/store" + storeTypes "github.com/cosmos/cosmos-sdk/store/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" + authKeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + authTypes "github.com/cosmos/cosmos-sdk/x/auth/types" + bankKeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + bankTypes "github.com/cosmos/cosmos-sdk/x/bank/types" + govTypes "github.com/cosmos/cosmos-sdk/x/gov/types" paramsKeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" + paramsTypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + "reflect" + "testing" "github.com/AssetMantle/modules/helpers" - baseHelpers "github.com/AssetMantle/modules/helpers/base" - "github.com/AssetMantle/modules/x/assets/mapper" - "github.com/AssetMantle/modules/x/assets/parameters" - "github.com/AssetMantle/modules/x/identities/auxiliaries/authenticate" - "github.com/AssetMantle/modules/x/maintainers/auxiliaries/deputize" ) -var ( - authenticateAuxiliary helpers.Auxiliary - deputizeAuxiliary helpers.Auxiliary -) +type MockAuxiliary struct { + mock.Mock +} + +var _ helpers.Auxiliary = (*MockAuxiliary)(nil) -type TestKeepers struct { - DeputizeKeeper helpers.TransactionKeeper +func (mockAuxiliary *MockAuxiliary) GetName() string { panic(mockAuxiliary) } +func (mockAuxiliary *MockAuxiliary) GetKeeper() helpers.AuxiliaryKeeper { + args := mockAuxiliary.Called() + return args.Get(0).(helpers.AuxiliaryKeeper) +} +func (mockAuxiliary *MockAuxiliary) Initialize(_ helpers.Mapper, _ helpers.ParameterManager, _ ...interface{}) helpers.Auxiliary { + panic(mockAuxiliary) } -func createTestInput(t *testing.T) (sdkTypes.Context, TestKeepers, helpers.Mapper, helpers.ParameterManager) { - var legacyAmino = baseHelpers.CodecPrototype().GetLegacyAmino() - - storeKey := sdkTypes.NewKVStoreKey("test") - paramsStoreKey := sdkTypes.NewKVStoreKey("testParams") - paramsTransientStoreKeys := sdkTypes.NewTransientStoreKey("testParamsTransient") - Mapper := mapper.Prototype().Initialize(storeKey) - codec := baseHelpers.TestCodec() - ParamsKeeper := paramsKeeper.NewKeeper( - codec, - legacyAmino, - paramsStoreKey, - paramsTransientStoreKeys, - ) - parameterManager := parameters.Prototype().Initialize(ParamsKeeper.Subspace("test")) +type MockAuxiliaryKeeper struct { + mock.Mock +} - memDB := tendermintDB.NewMemDB() - commitMultiStore := store.NewCommitMultiStore(memDB) - commitMultiStore.MountStoreWithDB(storeKey, storeTypes.StoreTypeIAVL, memDB) - commitMultiStore.MountStoreWithDB(paramsStoreKey, storeTypes.StoreTypeIAVL, memDB) - commitMultiStore.MountStoreWithDB(paramsTransientStoreKeys, storeTypes.StoreTypeTransient, memDB) - err := commitMultiStore.LoadLatestVersion() - require.Nil(t, err) +var _ helpers.AuxiliaryKeeper = (*MockAuxiliaryKeeper)(nil) - Context := sdkTypes.NewContext(commitMultiStore, protoTendermintTypes.Header{ - ChainID: "test", - }, false, log.NewNopLogger()) +func (mockAuxiliaryKeeper *MockAuxiliaryKeeper) Help(context context.Context, request helpers.AuxiliaryRequest) (helpers.AuxiliaryResponse, error) { + args := mockAuxiliaryKeeper.Called(context, request) + return args.Get(0).(helpers.AuxiliaryResponse), args.Error(1) +} +func (mockAuxiliaryKeeper *MockAuxiliaryKeeper) Initialize(m2 helpers.Mapper, manager helpers.ParameterManager, i []interface{}) helpers.Keeper { + args := mockAuxiliaryKeeper.Called(m2, manager, i) + return args.Get(0).(helpers.Keeper) +} - deputizeAuxiliary = deputize.Auxiliary.Initialize(Mapper, parameterManager) - authenticateAuxiliary = authenticate.Auxiliary.Initialize(Mapper, parameterManager) +const ( + TestMinterModuleName = "testMinter" + Denom = "stake" + ChainID = "testChain" + GenesisSupply = 1000000000000 +) - keepers := TestKeepers{ - DeputizeKeeper: keeperPrototype().Initialize(Mapper, parameterManager, []interface{}{}).(helpers.TransactionKeeper), - } +var ( + moduleStoreKey = sdkTypes.NewKVStoreKey(constants.ModuleName) - return Context, keepers, Mapper, parameterManager -} + authenticateAuxiliaryKeeper = new(MockAuxiliaryKeeper) + authenticateAuxiliaryFailureAddress = sdkTypes.AccAddress(ed25519.GenPrivKey().PubKey().Address()) + _ = authenticateAuxiliaryKeeper.On("Help", mock.Anything, authenticate.NewAuxiliaryRequest(authenticateAuxiliaryFailureAddress, baseIDs.PrototypeIdentityID())).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError) + _ = authenticateAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil) + authenticateAuxiliary = new(MockAuxiliary) + _ = authenticateAuxiliary.On("GetKeeper").Return(authenticateAuxiliaryKeeper) -func Test_keeperPrototype(t *testing.T) { - tests := []struct { - name string - want helpers.TransactionKeeper - }{ - {"+ve", transactionKeeper{}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := keeperPrototype(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("keeperPrototype() = %v, want %v", got, tt.want) - } - }) - } + deputizeAuxiliaryKeeper = new(MockAuxiliaryKeeper) + deputizeAuxiliaryFailureAddress = sdkTypes.AccAddress(ed25519.GenPrivKey().PubKey().Address()) + _ = deputizeAuxiliaryKeeper.On("Help", mock.Anything, deputize.NewAuxiliaryRequest(baseIDs.PrototypeIdentityID(), baseIDs.PrototypeIdentityID(), baseIDs.PrototypeClassificationID(), baseLists.NewPropertyList(), true, true, true, permissionHelper.SetModulePermissions(false, true, true)...)).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError) + _ = deputizeAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil) + deputizeAuxiliary = new(MockAuxiliary) + _ = deputizeAuxiliary.On("GetKeeper").Return(deputizeAuxiliaryKeeper) + + codec = baseHelpers.TestCodec() + + paramsStoreKey = sdkTypes.NewKVStoreKey(paramsTypes.StoreKey) + paramsTransientStoreKeys = sdkTypes.NewTransientStoreKey(paramsTypes.TStoreKey) + ParamsKeeper = paramsKeeper.NewKeeper(codec, codec.GetLegacyAmino(), paramsStoreKey, paramsTransientStoreKeys) + + authStoreKey = sdkTypes.NewKVStoreKey(authTypes.StoreKey) + moduleAccountPermissions = map[string][]string{TestMinterModuleName: {authTypes.Minter}, constants.ModuleName: nil} + AuthKeeper = authKeeper.NewAccountKeeper(codec, authStoreKey, authTypes.ProtoBaseAccount, moduleAccountPermissions, sdkTypes.GetConfig().GetBech32AccountAddrPrefix(), authTypes.NewModuleAddress(govTypes.ModuleName).String()) + + bankStoreKey = sdkTypes.NewKVStoreKey(bankTypes.StoreKey) + blacklistedAddresses = map[string]bool{authTypes.NewModuleAddress(TestMinterModuleName).String(): false, authTypes.NewModuleAddress(constants.ModuleName).String(): false} + BankKeeper = bankKeeper.NewBaseKeeper(codec, bankStoreKey, AuthKeeper, blacklistedAddresses, authTypes.NewModuleAddress(govTypes.ModuleName).String()) + + Context = setContext() + + coinSupply = sdkTypes.NewCoins(sdkTypes.NewCoin(Denom, sdkTypes.NewInt(GenesisSupply))) + _ = BankKeeper.MintCoins(Context, TestMinterModuleName, coinSupply) + + genesisAddress = sdkTypes.AccAddress(ed25519.GenPrivKey().PubKey().Address()) + _ = BankKeeper.SendCoinsFromModuleToAccount(Context, TestMinterModuleName, genesisAddress, coinSupply) + + parameterManager = parameters.Prototype().Initialize(ParamsKeeper.Subspace(constants.ModuleName).WithKeyTable(parameters.Prototype().GetKeyTable())). + Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.WrapAllowedCoinsProperty.GetKey(), baseData.NewListData(baseData.NewStringData(Denom)))))). + Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.BurnEnabledProperty.GetKey(), baseData.NewBooleanData(true))))). + Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.MintEnabledProperty.GetKey(), baseData.NewBooleanData(true))))). + Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.RenumerateEnabledProperty.GetKey(), baseData.NewBooleanData(true))))). + Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.UnwrapAllowedCoinsProperty.GetKey(), baseData.NewListData(baseData.NewStringData(Denom)))))) + TransactionKeeper = transactionKeeper{mapper.Prototype().Initialize(moduleStoreKey), parameterManager, authenticateAuxiliary, deputizeAuxiliary} +) + +func setContext() sdkTypes.Context { + memDB := tendermintDB.NewMemDB() + commitMultiStore := store.NewCommitMultiStore(memDB) + commitMultiStore.MountStoreWithDB(moduleStoreKey, storeTypes.StoreTypeIAVL, memDB) + commitMultiStore.MountStoreWithDB(authStoreKey, storeTypes.StoreTypeIAVL, memDB) + commitMultiStore.MountStoreWithDB(bankStoreKey, storeTypes.StoreTypeIAVL, memDB) + commitMultiStore.MountStoreWithDB(paramsStoreKey, storeTypes.StoreTypeIAVL, memDB) + commitMultiStore.MountStoreWithDB(paramsTransientStoreKeys, storeTypes.StoreTypeTransient, memDB) + _ = commitMultiStore.LoadLatestVersion() + return sdkTypes.NewContext(commitMultiStore, protoTendermintTypes.Header{ChainID: ChainID}, false, log.NewNopLogger()) } -func Test_transactionKeeper_Initialize(t *testing.T) { - _, _, Mapper, parameterManager := createTestInput(t) - type fields struct { - mapper helpers.Mapper - parameterManager helpers.ParameterManager - authenticateAuxiliary helpers.Auxiliary - deputizeAuxiliary helpers.Auxiliary - } +func TestTransactionKeeperTransact(t *testing.T) { + type args struct { - mapper helpers.Mapper - parameterManager helpers.ParameterManager - auxiliaries []interface{} + from sdkTypes.AccAddress + fromID ids.IdentityID + toID ids.IdentityID + canMintAsset bool + canRenumerateAsset bool + canBurnAsset bool + canAddMaintainer bool + CanRemoveMaintainer bool + CanMutateMaintainer bool } + tests := []struct { - name string - fields fields - args args - want helpers.Keeper + name string + args args + setup func() + want *TransactionResponse + wantErr helpers.Error }{ - {"+ve", fields{Mapper, parameterManager, authenticateAuxiliary, deputizeAuxiliary}, args{Mapper, parameterManager, []interface{}{}}, transactionKeeper{Mapper, parameterManager, authenticateAuxiliary, deputizeAuxiliary}}, + { + name: "Successful Transaction", + args: args{ + from: genesisAddress, + fromID: baseIDs.PrototypeIdentityID(), + toID: baseIDs.PrototypeIdentityID(), + canMintAsset: true, + canRenumerateAsset: true, + canBurnAsset: true, + canAddMaintainer: true, + CanRemoveMaintainer: true, + CanMutateMaintainer: true, + }, + setup: func() { + }, + want: newTransactionResponse(), + wantErr: nil, + }, + { + name: "Authentication Failure", + args: args{ + from: authenticateAuxiliaryFailureAddress, + fromID: baseIDs.PrototypeIdentityID(), + toID: baseIDs.PrototypeIdentityID(), + canMintAsset: true, + canRenumerateAsset: true, + canBurnAsset: true, + canAddMaintainer: true, + CanRemoveMaintainer: true, + CanMutateMaintainer: true, + }, + setup: func() { + }, + want: nil, + wantErr: errorConstants.MockError, + }, + { + name: "Deputize Failure", + args: args{ + from: genesisAddress, + fromID: baseIDs.PrototypeIdentityID(), + toID: baseIDs.PrototypeIdentityID(), + canMintAsset: false, + canRenumerateAsset: true, + canBurnAsset: true, + canAddMaintainer: true, + CanRemoveMaintainer: true, + CanMutateMaintainer: true, + }, + setup: func() { + }, + want: nil, + wantErr: errorConstants.MockError, + }, } + for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - transactionKeeper := transactionKeeper{ - mapper: tt.fields.mapper, - parameterManager: tt.fields.parameterManager, - authenticateAuxiliary: tt.fields.authenticateAuxiliary, - deputizeAuxiliary: tt.fields.deputizeAuxiliary, - } - if got := transactionKeeper.Initialize(tt.args.mapper, tt.args.parameterManager, tt.args.auxiliaries); !reflect.DeepEqual(fmt.Sprint(got), fmt.Sprint(tt.want)) { - t.Errorf("Initialize() = %v, want %v", got, tt.want) + tt.setup() + + got, err := TransactionKeeper.Transact(sdkTypes.WrapSDKContext(Context), + NewMessage(tt.args.from, + tt.args.fromID, + tt.args.toID, + baseIDs.PrototypeClassificationID(), + baseLists.NewPropertyList(), + tt.args.canMintAsset, + tt.args.canRenumerateAsset, + tt.args.canBurnAsset, + tt.args.canAddMaintainer, + tt.args.CanRemoveMaintainer, + tt.args.CanMutateMaintainer).(helpers.Message)) + + if tt.wantErr != nil { + require.Error(t, err) + require.Equal(t, tt.wantErr, err) + } else { + require.NoError(t, err) + require.Equal(t, tt.want, got) } }) } } -func Test_transactionKeeper_Transact(t *testing.T) { - Context, keepers, Mapper, parameterManager := createTestInput(t) - immutableProperties := baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("ID1"), baseData.NewStringData("ImmutableData"))) - immutables := baseQualified.NewImmutables(immutableProperties) - mutableProperties := baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("authentication"), baseData.NewListData())) - mutables := baseQualified.NewMutables(mutableProperties) - classificationID := baseIDs.NewClassificationID(immutables, mutables) - testAsset := base.NewAsset(classificationID, immutables, mutables) - fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - fromAccAddress, err := sdkTypes.AccAddressFromBech32(fromAddress) - require.Nil(t, err) - fromID := baseIDs.NewIdentityID(classificationID, immutables) - keepers.DeputizeKeeper.(transactionKeeper).mapper.NewCollection(sdkTypes.WrapSDKContext(Context)).Add(record.NewRecord(testAsset)) - type fields struct { - mapper helpers.Mapper - parameterManager helpers.ParameterManager - authenticateAuxiliary helpers.Auxiliary - deputizeAuxiliary helpers.Auxiliary - } - type args struct { - context context.Context - message helpers.Message - } +func Test_keeperPrototype(t *testing.T) { tests := []struct { - name string - fields fields - args args - want helpers.TransactionResponse - wantErr bool + name string + want helpers.TransactionKeeper }{ - {"+ve", fields{Mapper, parameterManager, authenticateAuxiliary, deputizeAuxiliary}, args{Context.Context(), NewMessage(fromAccAddress, fromID, fromID, classificationID, mutableProperties, true, true, true, true, true, true).(*Message)}, newTransactionResponse(), false}, + {"+ve", transactionKeeper{}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - transactionKeeper := transactionKeeper{ - mapper: tt.fields.mapper, - parameterManager: tt.fields.parameterManager, - authenticateAuxiliary: tt.fields.authenticateAuxiliary, - deputizeAuxiliary: tt.fields.deputizeAuxiliary, - } - got, err := transactionKeeper.Transact(tt.args.context, tt.args.message) - if (err != nil) != tt.wantErr { - t.Errorf("Transact() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("Transact() got = %v, want %v", got, tt.want) + if got := keeperPrototype(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("keeperPrototype() = %v, want %v", got, tt.want) } }) } diff --git a/x/assets/transactions/deputize/transaction_request.go b/x/assets/transactions/deputize/transaction_request.go index 8a6c6172f..f64f2e69f 100644 --- a/x/assets/transactions/deputize/transaction_request.go +++ b/x/assets/transactions/deputize/transaction_request.go @@ -12,7 +12,7 @@ import ( baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" + sdkCodec "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/AssetMantle/modules/helpers" @@ -119,7 +119,7 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { transactionRequest.CanMutateMaintainer, ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { +func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *sdkCodec.LegacyAmino) { codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) } func requestPrototype() helpers.TransactionRequest { diff --git a/x/assets/transactions/deputize/transaction_request_test.go b/x/assets/transactions/deputize/transaction_request_test.go index a1187081d..2e48388c3 100644 --- a/x/assets/transactions/deputize/transaction_request_test.go +++ b/x/assets/transactions/deputize/transaction_request_test.go @@ -15,7 +15,7 @@ import ( baseLists "github.com/AssetMantle/schema/lists/base" baseProperties "github.com/AssetMantle/schema/properties/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" + sdkCodec "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/spf13/viper" @@ -303,14 +303,14 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { CanMutateMaintainer bool } type args struct { - legacyAmino *codec.LegacyAmino + legacyAmino *sdkCodec.LegacyAmino } tests := []struct { name string fields fields args args }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), fmt.Sprint(mutableMetaProperties), true, true, true, true, true, true}, args{codec.NewLegacyAmino()}}, + {"+ve", fields{testBaseRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), fmt.Sprint(mutableMetaProperties), true, true, true, true, true, true}, args{sdkCodec.NewLegacyAmino()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) {