Skip to content

Commit

Permalink
mint tk test cases fix v1
Browse files Browse the repository at this point in the history
  • Loading branch information
Sid-AssetMantle committed Jul 23, 2024
1 parent aec1e1b commit 6ae05a2
Show file tree
Hide file tree
Showing 7 changed files with 279 additions and 154 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require (
google.golang.org/grpc v1.62.1
)

//replace github.com/AssetMantle/schema => ../schema
replace github.com/AssetMantle/schema => ../schema

require (
cloud.google.com/go v0.112.0 // indirect
Expand Down
1 change: 0 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3/go.mod h1:wMEGFFFN
git.sr.ht/~sircmpwn/go-bare v0.0.0-20210406120253-ab86bc2846d9/go.mod h1:BVJwbDfVjCjoFiKrhkei6NdGcZYpkDkdyCdg1ukytRA=
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs=
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4=
github.com/AssetMantle/schema v0.0.0-20240206102051-27352b802163/go.mod h1:SindcyQCFIEKPOp4mNrnegXrJ2uwQfq3D1r+G93Gz3Q=
github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM=
github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I=
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo=
Expand Down
4 changes: 2 additions & 2 deletions x/assets/transactions/mint/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -60,7 +60,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) {
Expand Down
8 changes: 4 additions & 4 deletions x/assets/transactions/mint/message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package mint

import (
sdkCodec "github.com/cosmos/cosmos-sdk/codec"
"reflect"
"testing"

Expand All @@ -14,7 +15,6 @@ 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"
sdkTypes "github.com/cosmos/cosmos-sdk/types"

"github.com/AssetMantle/modules/helpers"
Expand Down Expand Up @@ -111,15 +111,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, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}, args{codec.NewLegacyAmino()}},
{"+ve with nil", fields{}, args{sdkCodec.NewLegacyAmino()}},
{"+ve", fields{fromAccAddress.String(), fromID, fromID, classificationID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}, args{sdkCodec.NewLegacyAmino()}},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down
408 changes: 267 additions & 141 deletions x/assets/transactions/mint/transaction_keeper_test.go

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions x/assets/transactions/mint/transaction_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -127,7 +127,7 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) {
mutableProperties,
), nil
}
func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) {
func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *sdkCodec.LegacyAmino) {
codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{})
}
func requestPrototype() helpers.TransactionRequest {
Expand Down
6 changes: 3 additions & 3 deletions x/assets/transactions/mint/transaction_request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"encoding/json"
"fmt"
"github.com/AssetMantle/modules/utilities/rest"
sdkCodec "github.com/cosmos/cosmos-sdk/codec"
"reflect"
"testing"

Expand All @@ -15,7 +16,6 @@ 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"
"github.com/cosmos/cosmos-sdk/types"

"github.com/spf13/viper"
Expand Down Expand Up @@ -276,14 +276,14 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) {
MutableProperties string
}
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(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{codec.NewLegacyAmino()}},
{"+ve", fields{testBaseRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{sdkCodec.NewLegacyAmino()}},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit 6ae05a2

Please sign in to comment.