Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor x/staking according to ADR 031 #7556

Merged
merged 8 commits into from
Oct 16, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 46 additions & 6 deletions proto/cosmos/staking/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,28 @@ import "cosmos/staking/v1beta1/staking.proto";

option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types";

// MsgCreateValidator defines an SDK message for creating a new validator.
// Msg defines the bank Msg service.
atheeshp marked this conversation as resolved.
Show resolved Hide resolved
service Msg {
// CreateValidator defines a method for creating a new validator.
rpc CreateValidator(MsgCreateValidator) returns (MsgCreateValidatorResponse);

// EditValidator defines a method for editing an existing validator.
rpc EditValidator(MsgEditValidator) returns (MsgEditValidatorResponse);

// Delegate defines a method for performing a delegation of coins
// from a delegator to a validator.
rpc Delegate(MsgDelegate) returns (MsgDelegateResponse);

// BeginRedelegate defines a method for performing a redelegation
// of coins from a delegator and source validator to a destination validator.
rpc BeginRedelegate(MsgBeginRedelegate) returns (MsgBeginRedelegateResponse);

// Undelegate defines a method for performing an undelegation from a
// delegate and a validator.
rpc Undelegate(MsgUndelegate) returns (MsgUndelegateResponse);
}

// MsgCreateValidator defines a SDK message for creating a new validator.
message MsgCreateValidator {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
Expand All @@ -25,7 +46,10 @@ message MsgCreateValidator {
cosmos.base.v1beta1.Coin value = 7 [(gogoproto.nullable) = false];
}

// MsgEditValidator defines an SDK message for editing an existing validator.
// MsgCreateValidatorResponse defines the Msg/CreateValidator response type.
message MsgCreateValidatorResponse { }

// MsgEditValidator defines a SDK message for editing an existing validator.
message MsgEditValidator {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
Expand All @@ -48,7 +72,10 @@ message MsgEditValidator {
];
}

// MsgDelegate defines an SDK message for performing a delegation of coins
// MsgEditValidatorResponse defines the Msg/EditValidator response type.
message MsgEditValidatorResponse { }

// MsgDelegate defines a SDK message for performing a delegation of coins
// from a delegator to a validator.
message MsgDelegate {
option (gogoproto.equal) = false;
Expand All @@ -59,7 +86,10 @@ message MsgDelegate {
cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false];
}

// MsgBeginRedelegate defines an SDK message for performing a redelegation
// MsgDelegateResponse defines the Msg/Delegate response type.
message MsgDelegateResponse { }

// MsgBeginRedelegate defines a SDK message for performing a redelegation
// of coins from a delegator and source validator to a destination validator.
message MsgBeginRedelegate {
option (gogoproto.equal) = false;
Expand All @@ -71,7 +101,12 @@ message MsgBeginRedelegate {
cosmos.base.v1beta1.Coin amount = 4 [(gogoproto.nullable) = false];
}

// MsgUndelegate defines an SDK message for performing an undelegation from a
// MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type.
message MsgBeginRedelegateResponse {
bytes completion_time = 1;
atheeshp marked this conversation as resolved.
Show resolved Hide resolved
}

// MsgUndelegate defines a SDK message for performing an undelegation from a
// delegate and a validator.
message MsgUndelegate {
option (gogoproto.equal) = false;
Expand All @@ -80,4 +115,9 @@ message MsgUndelegate {
string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""];
string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""];
cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false];
}
}

// MsgUndelegateResponse defines the Msg/Undelegate response type.
message MsgUndelegateResponse {
bytes completion_time = 1;
atheeshp marked this conversation as resolved.
Show resolved Hide resolved
}
Loading