Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
update proto files
Browse files Browse the repository at this point in the history
  • Loading branch information
jhernandezb committed Feb 21, 2024
1 parent 1d5905d commit 507ccc0
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 16 deletions.
15 changes: 9 additions & 6 deletions proto/nois/allocation/v1/params.proto
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
syntax = "proto3";

package nois.allocation.v1;
import "gogoproto/gogo.proto";

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

option go_package = "github.com/noislabs/noisd/x/allocation/types";

// DistributionProportions defines the allocation distribution structure.
message DistributionProportions {
string developer_rewards = 1 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
Expand All @@ -23,19 +25,21 @@ message DistributionProportions {
(gogoproto.nullable) = false
];
}

// WeightedAddress defines the weight given to an address.
message WeightedAddress {
string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
string address = 1 [(gogoproto.moretags) = "yaml:\"address\""];
string weight = 2 [
(gogoproto.moretags) = "yaml:\"weight\"",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
}

// Params module params.
message Params {
// distribution_proportions defines the proportion of the minted denom
DistributionProportions distribution_proportions = 1
[ (gogoproto.nullable) = false ];
DistributionProportions distribution_proportions = 1 [(gogoproto.nullable) = false];

// address to receive developer rewards
repeated WeightedAddress weighted_developer_rewards_receivers = 2 [
Expand All @@ -44,6 +48,5 @@ message Params {
];

// address to receive randomness rewards
string randomness_rewards_receiver = 3
[ (gogoproto.moretags) = "yaml:\"randomness_rewards_receiver\"" ];
string randomness_rewards_receiver = 3 [(gogoproto.moretags) = "yaml:\"randomness_rewards_receiver\""];
}
15 changes: 9 additions & 6 deletions proto/nois/allocation/v1/query.proto
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
syntax = "proto3";
package nois.allocation.v1;

import "cosmos/base/v1beta1/coin.proto";
import "gogoproto/gogo.proto";
import "nois/allocation/v1/params.proto";
import "google/api/annotations.proto";
import "cosmos/base/v1beta1/coin.proto";
import "nois/allocation/v1/params.proto";

option go_package = "github.com/noislabs/noisd/x/allocation/types";

Expand All @@ -14,24 +14,27 @@ message QueryParamsRequest {}
// QueryParamsResponse is the response type for the Query/Params RPC method.
message QueryParamsResponse {
// params defines the parameters of the module.
Params params = 1 [ (gogoproto.nullable) = false ];
Params params = 1 [(gogoproto.nullable) = false];
}

// Query defines the gRPC querier service.
service Query {
// Params returns the module params.
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/nois/alocation/v1/params";
}
rpc ClaimableRewards(QueryClaimableRewardsRequest)
returns (QueryClaimableRewardsResponse) {
// ClaimableRewards returns how many rewards accumulated by an address.
rpc ClaimableRewards(QueryClaimableRewardsRequest) returns (QueryClaimableRewardsResponse) {
option (google.api.http).get = "/nois/alocation/v1/claimable_rewards";
}
}

// QueryClaimableRewardsRequest claimable rewards request.
message QueryClaimableRewardsRequest {
string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
string address = 1 [(gogoproto.moretags) = "yaml:\"address\""];
}

// QueryClaimableRewardsResponse claimable rewards response.
message QueryClaimableRewardsResponse {
repeated cosmos.base.v1beta1.Coin coins = 1 [
(gogoproto.moretags) = "yaml:\"coins\"",
Expand Down
5 changes: 3 additions & 2 deletions proto/nois/allocation/v1/rewards.proto
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
syntax = "proto3";
package nois.allocation.v1;

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

option go_package = "github.com/noislabs/noisd/x/allocation/types";

// ValidatorReward defines the validator rewards structure.
message ValidatorReward {
// validator address
string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
string address = 1 [(gogoproto.moretags) = "yaml:\"address\""];

// accumulated validator rewards
repeated cosmos.base.v1beta1.Coin rewards = 2 [
Expand Down
13 changes: 11 additions & 2 deletions proto/nois/allocation/v1/tx.proto
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
syntax = "proto3";

package nois.allocation.v1;
import "gogoproto/gogo.proto";

import "cosmos/base/v1beta1/coin.proto";
import "cosmos/msg/v1/msg.proto";
import "gogoproto/gogo.proto";

option go_package = "github.com/noislabs/noisd/x/allocation/types";

// Msg defines the allocation Msg service.
service Msg {
// ClaimRewards method for claiming validator rewards.
rpc ClaimRewards(MsgClaimRewards) returns (MsgClaimRewardsResponse);
}

message MsgClaimRewards { string sender = 1; }
// MsgClaimRewards defines the claim rewards message.
message MsgClaimRewards {
option (cosmos.msg.v1.signer) = "sender";
string sender = 1;
}

// MsgClaimRewardsResponse defines the claim rewards response.
message MsgClaimRewardsResponse {
// claimed rewards amount
repeated cosmos.base.v1beta1.Coin claimed_rewards = 1 [
Expand Down

0 comments on commit 507ccc0

Please sign in to comment.