From 8d50a69581f89fc72fac7b392992e062cb513e8c Mon Sep 17 00:00:00 2001 From: PoisonPhang <17688291+PoisonPhang@users.noreply.github.com> Date: Thu, 25 Jan 2024 16:11:06 -0600 Subject: [PATCH 1/2] fix(tokenfactory): use cosmos.msg in proto --- uniond/proto/tokenfactory/v1beta1/tx.proto | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/uniond/proto/tokenfactory/v1beta1/tx.proto b/uniond/proto/tokenfactory/v1beta1/tx.proto index f58f1c9589..a60afb6b07 100644 --- a/uniond/proto/tokenfactory/v1beta1/tx.proto +++ b/uniond/proto/tokenfactory/v1beta1/tx.proto @@ -4,11 +4,14 @@ package tokenfactory.v1beta1; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmos/bank/v1beta1/bank.proto"; +import "cosmos/msg/v1/msg.proto"; option go_package = "union/x/tokenfactory/types"; // Msg defines the tokefactory module's gRPC message service. service Msg { + option (cosmos.msg.v1.service) = true; + rpc CreateDenom(MsgCreateDenom) returns (MsgCreateDenomResponse); rpc Mint(MsgMint) returns (MsgMintResponse); rpc Burn(MsgBurn) returns (MsgBurnResponse); @@ -27,6 +30,8 @@ service Msg { // originally set to be the creator, but this can be changed later. The token // denom does not indicate the current admin. message MsgCreateDenom { + option (cosmos.msg.v1.signer) = "sender"; + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; // subdenom can be up to 44 "alphanumeric" characters long. string subdenom = 2 [ (gogoproto.moretags) = "yaml:\"subdenom\"" ]; @@ -42,6 +47,8 @@ message MsgCreateDenomResponse { // MsgMint is the sdk.Msg type for allowing an admin account to mint // more of a token. For now, we only support minting to the sender account message MsgMint { + option (cosmos.msg.v1.signer) = "sender"; + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; cosmos.base.v1beta1.Coin amount = 2 [ (gogoproto.moretags) = "yaml:\"amount\"", @@ -56,6 +63,8 @@ message MsgMintResponse {} // MsgBurn is the sdk.Msg type for allowing an admin account to burn // a token. For now, we only support burning from the sender account. message MsgBurn { + option (cosmos.msg.v1.signer) = "sender"; + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; cosmos.base.v1beta1.Coin amount = 2 [ (gogoproto.moretags) = "yaml:\"amount\"", @@ -70,6 +79,8 @@ message MsgBurnResponse {} // MsgChangeAdmin is the sdk.Msg type for allowing an admin account to reassign // adminship of a denom to a new account message MsgChangeAdmin { + option (cosmos.msg.v1.signer) = "sender"; + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; string denom = 2 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; string new_admin = 3 [ (gogoproto.moretags) = "yaml:\"new_admin\"" ]; @@ -82,6 +93,8 @@ message MsgChangeAdminResponse {} // MsgSetDenomMetadata is the sdk.Msg type for allowing an admin account to set // the denom's bank metadata message MsgSetDenomMetadata { + option (cosmos.msg.v1.signer) = "sender"; + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; cosmos.bank.v1beta1.Metadata metadata = 2 [ (gogoproto.moretags) = "yaml:\"metadata\"", From 153eba551917d363abbfe18a4d5c35c9c0e51d67 Mon Sep 17 00:00:00 2001 From: PoisonPhang <17688291+PoisonPhang@users.noreply.github.com> Date: Thu, 25 Jan 2024 16:11:19 -0600 Subject: [PATCH 2/2] chore: gen proto --- uniond/x/tokenfactory/types/tx.pb.go | 84 +++++++++++++++------------- 1 file changed, 44 insertions(+), 40 deletions(-) diff --git a/uniond/x/tokenfactory/types/tx.pb.go b/uniond/x/tokenfactory/types/tx.pb.go index 349b930059..ed15915b18 100644 --- a/uniond/x/tokenfactory/types/tx.pb.go +++ b/uniond/x/tokenfactory/types/tx.pb.go @@ -8,6 +8,7 @@ import ( context "context" fmt "fmt" types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" types1 "github.com/cosmos/cosmos-sdk/x/bank/types" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -543,46 +544,49 @@ func init() { func init() { proto.RegisterFile("tokenfactory/v1beta1/tx.proto", fileDescriptor_5ae6d2a5cb7a1208) } var fileDescriptor_5ae6d2a5cb7a1208 = []byte{ - // 621 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x55, 0xcd, 0x4e, 0xd4, 0x40, - 0x1c, 0xdf, 0x8a, 0x22, 0x0c, 0xe2, 0x42, 0x41, 0x5c, 0xab, 0xdb, 0x9a, 0x89, 0x1a, 0x4d, 0x4c, - 0x9b, 0x45, 0x4f, 0x9e, 0xa4, 0x18, 0xe2, 0xc1, 0x5e, 0x2a, 0x27, 0x63, 0xb2, 0x99, 0xa5, 0x43, - 0x6d, 0xa0, 0x33, 0x9b, 0xce, 0xac, 0xc0, 0x5b, 0x78, 0x30, 0x3e, 0x8f, 0x27, 0xc3, 0x91, 0xa3, - 0x5e, 0x1a, 0x03, 0x6f, 0xd0, 0x27, 0x30, 0xf3, 0xd1, 0x8f, 0x5d, 0x60, 0x03, 0x27, 0x6f, 0xbb, - 0xfd, 0x7d, 0xcc, 0xff, 0x37, 0xf3, 0x9b, 0x16, 0x74, 0x39, 0xdd, 0xc3, 0x64, 0x17, 0xed, 0x70, - 0x9a, 0x1d, 0x79, 0x5f, 0x7b, 0x03, 0xcc, 0x51, 0xcf, 0xe3, 0x87, 0xee, 0x30, 0xa3, 0x9c, 0x9a, - 0xab, 0x4d, 0xd8, 0xd5, 0xb0, 0xb5, 0x1a, 0xd3, 0x98, 0x4a, 0x82, 0x27, 0x7e, 0x29, 0xae, 0x65, - 0xef, 0x50, 0x96, 0x52, 0xe6, 0x0d, 0x10, 0xc3, 0x95, 0xd3, 0x0e, 0x4d, 0xc8, 0x39, 0x9c, 0xec, - 0x55, 0xb8, 0xf8, 0xa3, 0x70, 0xb8, 0x0f, 0xee, 0x06, 0x2c, 0xde, 0xcc, 0x30,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, 0xeb, 0xe9, 0x54, 0xb8, 0xe9, 0x26, 0x9b, 0x7f, - 0xb9, 0x9b, 0x80, 0xa7, 0xb8, 0x35, 0xfb, 0x26, 0xe3, 0x37, 0xba, 0x36, 0x25, 0x7e, 0xcd, 0x9a, - 0x16, 0xff, 0x7c, 0x3f, 0xcc, 0x21, 0x58, 0x3a, 0xdf, 0x8d, 0x4b, 0x1d, 0x26, 0xa9, 0x56, 0xef, - 0xca, 0xd4, 0x72, 0x45, 0xff, 0xf5, 0xf1, 0xa9, 0x6d, 0x9c, 0x9c, 0xda, 0xc6, 0xdf, 0x53, 0xdb, - 0xf8, 0x76, 0x66, 0xb7, 0x4e, 0xce, 0xec, 0xd6, 0xef, 0x33, 0xbb, 0xf5, 0xc9, 0x1a, 0x91, 0x84, - 0x12, 0xef, 0xd0, 0x1b, 0xfb, 0xde, 0xf0, 0xa3, 0x21, 0x66, 0x83, 0x59, 0xf9, 0xfe, 0x7f, 0xf5, - 0x2f, 0x00, 0x00, 0xff, 0xff, 0x48, 0x02, 0x9d, 0x27, 0x8c, 0x06, 0x00, 0x00, + // 660 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x55, 0x4d, 0x4f, 0xd4, 0x4e, + 0x1c, 0xde, 0xfe, 0xf9, 0x83, 0x30, 0x88, 0x0b, 0x05, 0x61, 0xad, 0x6e, 0x6b, 0x26, 0x6a, 0x94, + 0x98, 0x36, 0x8b, 0x9e, 0x38, 0xc9, 0x62, 0x88, 0x07, 0xf7, 0x52, 0x39, 0x19, 0x93, 0xcd, 0x2c, + 0x3b, 0xd4, 0x0d, 0x76, 0x66, 0xd3, 0x99, 0x05, 0xf6, 0x66, 0xfc, 0x04, 0x7e, 0x05, 0xe3, 0x17, + 0xe0, 0x63, 0x70, 0x31, 0x21, 0xf1, 0xe2, 0xa9, 0x21, 0x70, 0xe0, 0xde, 0x4f, 0x60, 0xe6,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, 0x4a, 0x62, 0x67, 0x59, 0xd9, 0x8f, 0x10, 0xa0, 0x3f, 0x47, 0xf0, 0xc1, + 0xb6, 0xb8, 0x21, 0xbd, 0xe0, 0x2f, 0x03, 0xdc, 0x69, 0xb1, 0xa0, 0xd5, 0x23, 0xfc, 0x36, 0x91, + 0xde, 0x81, 0x29, 0x14, 0xd2, 0x01, 0xe1, 0x32, 0xd0, 0xec, 0xda, 0x03, 0x57, 0xad, 0x9c, 0x2b, + 0x56, 0x3e, 0xdd, 0x24, 0x77, 0x93, 0xf6, 0x48, 0xf3, 0xfe, 0x71, 0xec, 0x54, 0x72, 0x27, 0x25, + 0x83, 0xbe, 0xd6, 0x9b, 0x6f, 0xc0, 0x5c, 0xd8, 0x23, 0x7c, 0x9b, 0x6e, 0x74, 0xbb, 0x11, 0x66, + 0xac, 0x36, 0x31, 0x1a, 0x41, 0xc0, 0x6d, 0x4e, 0xdb, 0x48, 0x11, 0xa0, 0x5f, 0x16, 0x94, 0x57, + 0x6b, 0x01, 0x54, 0x75, 0x9c, 0x74, 0x99, 0xe0, 0x6f, 0x15, 0xb1, 0x39, 0x88, 0xc8, 0xbf, 0x89, + 0xb8, 0x05, 0xaa, 0x9d, 0x41, 0x44, 0xb6, 0x22, 0x1a, 0x96, 0x43, 0x3e, 0x4a, 0x62, 0xa7, 0xa6, + 0x34, 0x82, 0xd0, 0xde, 0x8d, 0x68, 0x98, 0xc7, 0x1c, 0x15, 0x5d, 0x15, 0x54, 0x84, 0xca, 0x82, + 0xfe, 0x34, 0x54, 0x4b, 0x3f, 0x23, 0x12, 0xe0, 0x8d, 0x6e, 0xd8, 0xbb, 0x55, 0xde, 0x67, 0x60, + 0xb2, 0x58, 0xd1, 0xf9, 0x24, 0x76, 0xee, 0x2a, 0xa6, 0x6e, 0x8e, 0x82, 0xcd, 0x06, 0x98, 0x11, + 0xa5, 0x42, 0xc2, 0x5f, 0xe7, 0x58, 0x4a, 0x62, 0x67, 0x3e, 0xef, 0x9b, 0x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, 0x2b, 0x1f, 0xad, 0x01, 0xe9, 0x51, 0xe2, 0x1d, 0x7a, 0xa5, 0x0f, 0x1a, 0x1f, 0xf6, 0x31, + 0xeb, 0x4c, 0xc9, 0xef, 0xc8, 0xab, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe3, 0xcb, 0x0a, 0x4d, + 0xed, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used.