Skip to content

Commit

Permalink
Using cosmossdk.io/math package for Int and Dec in proto files
Browse files Browse the repository at this point in the history
  • Loading branch information
bsrinivas8687 committed Nov 14, 2023
1 parent cbc586d commit 70a3370
Show file tree
Hide file tree
Showing 16 changed files with 259 additions and 254 deletions.
12 changes: 6 additions & 6 deletions proto/sentinel/mint/v1/inflation.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,34 @@ option (gogoproto.goproto_getters_all) = false;
// Inflation represents a message for handling inflation parameters.
message Inflation {
// Field 1: Maximum inflation rate.
// - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec":
// - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec":
// Custom type definition for the field.
// - (gogoproto.moretags) = "yaml:\"max\"": YAML tag for better representation.
// - (gogoproto.nullable) = false: Field is not nullable.
string max = 1 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.moretags) = "yaml:\"max\"",
(gogoproto.nullable) = false
];

// Field 2: Minimum inflation rate.
// - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec":
// - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec":
// Custom type definition for the field.
// - (gogoproto.moretags) = "yaml:\"min\"": YAML tag for better representation.
// - (gogoproto.nullable) = false: Field is not nullable.
string min = 2 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.moretags) = "yaml:\"min\"",
(gogoproto.nullable) = false
];

// Field 3: Rate of change of inflation.
// - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec":
// - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec":
// Custom type definition for the field.
// - (gogoproto.moretags) = "yaml:\"rate_change\"": YAML tag for better representation.
// - (gogoproto.nullable) = false: Field is not nullable.
string rate_change = 3 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.moretags) = "yaml:\"rate_change\"",
(gogoproto.nullable) = false
];
Expand Down
4 changes: 2 additions & 2 deletions proto/sentinel/node/v2/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ message Params {
int64 min_subscription_hours = 10;

// Field 11: Staking share required for a node.
// - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec":
// - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec":
// Custom type definition for the field.
// - (gogoproto.nullable) = false: Field is not nullable.
string staking_share = 11 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.nullable) = false
];
}
4 changes: 2 additions & 2 deletions proto/sentinel/provider/v2/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ message Params {
cosmos.base.v1beta1.Coin deposit = 1 [(gogoproto.nullable) = false];

// Field 2: Staking share associated with the providers.
// - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec":
// - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec":
// Custom type definition for the field.
// - (gogoproto.nullable) = false: Field is not nullable.
string staking_share = 2 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.nullable) = false
];
}
4 changes: 2 additions & 2 deletions proto/sentinel/subscription/v2/allocation.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ message Allocation {

// Field 3: Granted bytes.
string granted_bytes = 3 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];

// Field 4: Utilized bytes.
string utilised_bytes = 4 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];
}
4 changes: 2 additions & 2 deletions proto/sentinel/subscription/v2/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ message EventAllocate {

// Field 2: Granted bytes in the allocation.
string granted_bytes = 2 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];

// Field 3: Utilized bytes in the allocation.
string utilised_bytes = 3 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];

Expand Down
2 changes: 1 addition & 1 deletion proto/sentinel/subscription/v2/msg.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ message MsgAllocateRequest {

// Field 4: Number of bytes to allocate.
string bytes = 4 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];
}
Expand Down
2 changes: 1 addition & 1 deletion proto/sentinel/swap/v1/msg.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ message MsgSwapRequest {
bytes tx_hash = 2;
string receiver = 3;
string amount = 4 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];
}
Expand Down
14 changes: 8 additions & 6 deletions proto/sentinel/types/v1/bandwidth.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,19 @@ option (gogoproto.goproto_getters_all) = false;

// Bandwidth represents information about upload and download bandwidth.
message Bandwidth {
// Field 1: Upload bandwidth, represented as a Cosmos SDK Int type.
// This field is not nullable.
// Upload bandwidth value represented as a string.
// It uses a custom type "cosmossdk.io/math.Int".
// The value is not nullable, as indicated by "(gogoproto.nullable) = false".
string upload = 1 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];

// Field 2: Download bandwidth, represented as a Cosmos SDK Int type.
// This field is not nullable.
// Download bandwidth value represented as a string.
// It uses a custom type "cosmossdk.io/math.Int".
// The value is not nullable, as indicated by "(gogoproto.nullable) = false".
string download = 2 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];
}
38 changes: 20 additions & 18 deletions types/bandwidth.pb.go

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

60 changes: 30 additions & 30 deletions x/mint/types/inflation.pb.go

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

Loading

0 comments on commit 70a3370

Please sign in to comment.