Skip to content

Commit

Permalink
Revert removal of coin.proto
Browse files Browse the repository at this point in the history
  • Loading branch information
timlind committed Apr 26, 2021
1 parent 83fa95e commit bcff4d5
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 55 deletions.
4 changes: 3 additions & 1 deletion proto/sifnode/dispensation/v1/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ syntax = "proto3";
package sifnode.dispensation.v1;

import "gogoproto/gogo.proto";
import "cosmos/base/coin.proto";

option go_package = "github.com/Sifchain/sifnode/x/dispensation/types";

Expand Down Expand Up @@ -32,7 +33,8 @@ message DistributionRecord {
ClaimStatus claim_status = 1;
string distribution_name = 2;
string recipient_address = 3;
repeated string coins = 4 [
repeated cosmos.base.v1beta1.Coin coins = 4 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
(gogoproto.moretags) = "yaml:\"coins\""
];
Expand Down
40 changes: 40 additions & 0 deletions third_party/proto/cosmos/base/coin.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
syntax = "proto3";
package cosmos.base.v1beta1;

import "gogoproto/gogo.proto";

option go_package = "github.com/cosmos/cosmos-sdk/types";
option (gogoproto.goproto_stringer_all) = false;
option (gogoproto.stringer_all) = false;

// Coin defines a token with a denomination and an amount.
//
// NOTE: The amount field is an Int which implements the custom method
// signatures required by gogoproto.
message Coin {
option (gogoproto.equal) = true;

string denom = 1;
string amount = 2 [(gogoproto.customtype) = "Int", (gogoproto.nullable) = false];
}

// DecCoin defines a token with a denomination and a decimal amount.
//
// NOTE: The amount field is an Dec which implements the custom method
// signatures required by gogoproto.
message DecCoin {
option (gogoproto.equal) = true;

string denom = 1;
string amount = 2 [(gogoproto.customtype) = "Dec", (gogoproto.nullable) = false];
}

// IntProto defines a Protobuf wrapper around an Int object.
message IntProto {
string int = 1 [(gogoproto.customtype) = "Int", (gogoproto.nullable) = false];
}

// DecProto defines a Protobuf wrapper around a Dec object.
message DecProto {
string dec = 1 [(gogoproto.customtype) = "Dec", (gogoproto.nullable) = false];
}
118 changes: 64 additions & 54 deletions x/dispensation/types/types.pb.go

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

0 comments on commit bcff4d5

Please sign in to comment.