Skip to content

Commit

Permalink
fix: tokenfactory uses cosmos.msg (#1209)
Browse files Browse the repository at this point in the history
- Uses the cosmos.msg type for `x/tokenfactory` messages
- Fixes e2e nightly test `upgrade-with-tokenfactory-state`
  • Loading branch information
PoisonPhang authored Jan 26, 2024
2 parents 5c86d17 + 153eba5 commit f22f9ac
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 40 deletions.
13 changes: 13 additions & 0 deletions uniond/proto/tokenfactory/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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\"" ];
Expand All @@ -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\"",
Expand All @@ -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\"",
Expand All @@ -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\"" ];
Expand All @@ -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\"",
Expand Down
84 changes: 44 additions & 40 deletions uniond/x/tokenfactory/types/tx.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f22f9ac

Please sign in to comment.