Skip to content

Commit

Permalink
feat: add amino support (#21)
Browse files Browse the repository at this point in the history
* feat: add amino support

* fix: copy paste amino name
  • Loading branch information
fmorency authored Sep 23, 2024
1 parent 1a52984 commit 28f6fbe
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 64 deletions.
29 changes: 22 additions & 7 deletions proto/osmosis/tokenfactory/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import "cosmos/bank/v1beta1/bank.proto";
import "osmosis/tokenfactory/v1beta1/params.proto";
import "cosmos/msg/v1/msg.proto";
import "cosmos_proto/cosmos.proto";
import "amino/amino.proto";

option go_package = "github.com/strangelove-ventures/tokenfactory/x/tokenfactory/types";

Expand Down Expand Up @@ -40,6 +41,7 @@ service Msg {
// denom does not indicate the current admin.
message MsgCreateDenom {
option (cosmos.msg.v1.signer) = "sender";
option (amino.name) = "osmosis/tokenfactory/create-denom";

string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
// subdenom can be up to 44 "alphanumeric" characters long.
Expand All @@ -57,14 +59,18 @@ message MsgCreateDenomResponse {
// more of a token. For now, we only support minting to the sender account
message MsgMint {
option (cosmos.msg.v1.signer) = "sender";
option (amino.name) = "osmosis/tokenfactory/mint";

string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
cosmos.base.v1beta1.Coin amount = 2 [
(gogoproto.moretags) = "yaml:\"amount\"",
(gogoproto.nullable) = false
(gogoproto.nullable) = false,
(amino.encoding) = "legacy_coin"
];
string mintToAddress = 3 [
(gogoproto.moretags) = "yaml:\"mint_to_address\"",
(amino.dont_omitempty) = true
];
string mintToAddress = 3
[ (gogoproto.moretags) = "yaml:\"mint_to_address\"" ];
}

message MsgMintResponse {}
Expand All @@ -73,14 +79,18 @@ message MsgMintResponse {}
// a token. For now, we only support burning from the sender account.
message MsgBurn {
option (cosmos.msg.v1.signer) = "sender";
option (amino.name) = "osmosis/tokenfactory/burn";

string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
cosmos.base.v1beta1.Coin amount = 2 [
(gogoproto.moretags) = "yaml:\"amount\"",
(gogoproto.nullable) = false
(gogoproto.nullable) = false,
(amino.encoding) = "legacy_coin"
];
string burnFromAddress = 3 [
(gogoproto.moretags) = "yaml:\"burn_from_address\"",
(amino.dont_omitempty) = true
];
string burnFromAddress = 3
[ (gogoproto.moretags) = "yaml:\"burn_from_address\"" ];
}

message MsgBurnResponse {}
Expand All @@ -89,6 +99,7 @@ message MsgBurnResponse {}
// adminship of a denom to a new account
message MsgChangeAdmin {
option (cosmos.msg.v1.signer) = "sender";
option (amino.name) = "osmosis/tokenfactory/change-admin";

string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
string denom = 2 [ (gogoproto.moretags) = "yaml:\"denom\"" ];
Expand All @@ -103,6 +114,7 @@ message MsgChangeAdminResponse {}
// the denom's bank metadata
message MsgSetDenomMetadata {
option (cosmos.msg.v1.signer) = "sender";
option (amino.name) = "osmosis/tokenfactory/set-denom-metadata";

string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
cosmos.bank.v1beta1.Metadata metadata = 2 [
Expand All @@ -117,11 +129,13 @@ message MsgSetDenomMetadataResponse {}

message MsgForceTransfer {
option (cosmos.msg.v1.signer) = "sender";
option (amino.name) = "osmosis/tokenfactory/force-transfer";

string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
cosmos.base.v1beta1.Coin amount = 2 [
(gogoproto.moretags) = "yaml:\"amount\"",
(gogoproto.nullable) = false
(gogoproto.nullable) = false,
(amino.encoding) = "legacy_coin"
];
string transferFromAddress = 3
[ (gogoproto.moretags) = "yaml:\"transfer_from_address\"" ];
Expand All @@ -136,6 +150,7 @@ message MsgForceTransferResponse {}
// Since: cosmos-sdk 0.47
message MsgUpdateParams {
option (cosmos.msg.v1.signer) = "authority";
option (amino.name) = "osmosis/tokenfactory/update-params";

// authority is the address of the governance account.
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
Expand Down
120 changes: 63 additions & 57 deletions 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 28f6fbe

Please sign in to comment.