Skip to content

Commit

Permalink
Merge pull request #449 from AssetMantle/sid-master-tc-merge
Browse files Browse the repository at this point in the history
Transaction keeper testcase-master merge
  • Loading branch information
deepanshutr authored Aug 27, 2024
2 parents 9e5f20b + 3dff9b5 commit 7c1b155
Show file tree
Hide file tree
Showing 47 changed files with 1,940 additions and 1,055 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/burn/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
codecUtilities "github.com/AssetMantle/schema/codec/utilities"
"github.com/AssetMantle/schema/ids"
baseIDs "github.com/AssetMantle/schema/ids/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 @@ -43,7 +43,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/burn/message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,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"
Expand Down Expand Up @@ -99,15 +99,15 @@ func Test_message_RegisterCodec(t *testing.T) {
AssetID ids.AssetID
}
type args struct {
legacyAmino *codec.LegacyAmino
legacyAmino *sdkCodec.LegacyAmino
}
tests := []struct {
name string
fields fields
args args
}{
{"+ve", fields{fromAccAddress, fromID, testAssetID}, args{codec.NewLegacyAmino()}},
{"+ve", fields{}, args{codec.NewLegacyAmino()}},
{"+ve", fields{fromAccAddress, fromID, testAssetID}, args{sdkCodec.NewLegacyAmino()}},
{"+ve", fields{}, args{sdkCodec.NewLegacyAmino()}},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down
529 changes: 383 additions & 146 deletions x/assets/transactions/burn/transaction_keeper_test.go

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions x/assets/transactions/burn/transaction_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/AssetMantle/schema/ids"
baseIDs "github.com/AssetMantle/schema/ids/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 @@ -84,7 +84,7 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) {
assetID.(ids.AssetID),
), 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/burn/transaction_request_test.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/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"
Expand Down Expand Up @@ -210,14 +210,14 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) {
AssetID string
}
type args struct {
legacyAmino *codec.LegacyAmino
legacyAmino *sdkCodec.LegacyAmino
}
tests := []struct {
name string
fields fields
args args
}{
{"+ve", fields{testBaseRequest, fromID.AsString(), testAssetID.AsString()}, args{codec.NewLegacyAmino()}},
{"+ve", fields{testBaseRequest, fromID.AsString(), testAssetID.AsString()}, args{sdkCodec.NewLegacyAmino()}},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions x/assets/transactions/define/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 @@ -54,7 +54,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
6 changes: 3 additions & 3 deletions x/assets/transactions/define/message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -107,14 +107,14 @@ 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", fields{fromAccAddress.String(), fromID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}, args{codec.NewLegacyAmino()}},
{"+ve", fields{fromAccAddress.String(), fromID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}, args{sdkCodec.NewLegacyAmino()}},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down
Loading

0 comments on commit 7c1b155

Please sign in to comment.