-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: port across custom staking module from cosmos-sdk fork
- Loading branch information
Showing
117 changed files
with
45,256 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
syntax = "proto3"; | ||
package cosmos.staking.v1beta1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "cosmos_proto/cosmos.proto"; | ||
import "cosmos/base/v1beta1/coin.proto"; | ||
|
||
option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; | ||
|
||
// StakeAuthorization defines authorization for delegate/undelegate/redelegate. | ||
// | ||
// Since: cosmos-sdk 0.43 | ||
message StakeAuthorization { | ||
option (cosmos_proto.implements_interface) = "Authorization"; | ||
|
||
// max_tokens specifies the maximum amount of tokens can be delegate to a validator. If it is | ||
// empty, there is no spend limit and any amount of coins can be delegated. | ||
cosmos.base.v1beta1.Coin max_tokens = 1 [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin"]; | ||
// validators is the oneof that represents either allow_list or deny_list | ||
oneof validators { | ||
// allow_list specifies list of validator addresses to whom grantee can delegate tokens on behalf of granter's | ||
// account. | ||
Validators allow_list = 2; | ||
// deny_list specifies list of validator addresses to whom grantee can not delegate tokens. | ||
Validators deny_list = 3; | ||
} | ||
// Validators defines list of validator addresses. | ||
message Validators { | ||
repeated string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; | ||
} | ||
// authorization_type defines one of AuthorizationType. | ||
AuthorizationType authorization_type = 4; | ||
} | ||
|
||
// AuthorizationType defines the type of staking module authorization type | ||
// | ||
// Since: cosmos-sdk 0.43 | ||
enum AuthorizationType { | ||
// AUTHORIZATION_TYPE_UNSPECIFIED specifies an unknown authorization type | ||
AUTHORIZATION_TYPE_UNSPECIFIED = 0; | ||
// AUTHORIZATION_TYPE_DELEGATE defines an authorization type for Msg/Delegate | ||
AUTHORIZATION_TYPE_DELEGATE = 1; | ||
// AUTHORIZATION_TYPE_UNDELEGATE defines an authorization type for Msg/Undelegate | ||
AUTHORIZATION_TYPE_UNDELEGATE = 2; | ||
// AUTHORIZATION_TYPE_REDELEGATE defines an authorization type for Msg/BeginRedelegate | ||
AUTHORIZATION_TYPE_REDELEGATE = 3; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
syntax = "proto3"; | ||
package cosmos.staking.v1beta1; | ||
|
||
option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "cosmos/staking/v1beta1/staking.proto"; | ||
import "cosmos_proto/cosmos.proto"; | ||
|
||
// GenesisState defines the staking module's genesis state. | ||
message GenesisState { | ||
// params defines all the paramaters of related to deposit. | ||
Params params = 1 [(gogoproto.nullable) = false]; | ||
|
||
// last_total_power tracks the total amounts of bonded tokens recorded during | ||
// the previous end block. | ||
bytes last_total_power = 2 | ||
[(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; | ||
|
||
// last_validator_powers is a special index that provides a historical list | ||
// of the last-block's bonded validators. | ||
repeated LastValidatorPower last_validator_powers = 3 [(gogoproto.nullable) = false]; | ||
|
||
// delegations defines the validator set at genesis. | ||
repeated Validator validators = 4 [(gogoproto.nullable) = false]; | ||
|
||
// delegations defines the delegations active at genesis. | ||
repeated Delegation delegations = 5 [(gogoproto.nullable) = false]; | ||
|
||
// unbonding_delegations defines the unbonding delegations active at genesis. | ||
repeated UnbondingDelegation unbonding_delegations = 6 [(gogoproto.nullable) = false]; | ||
|
||
// redelegations defines the redelegations active at genesis. | ||
repeated Redelegation redelegations = 7 [(gogoproto.nullable) = false]; | ||
|
||
bool exported = 8; | ||
} | ||
|
||
// LastValidatorPower required for validator set update logic. | ||
message LastValidatorPower { | ||
option (gogoproto.equal) = false; | ||
option (gogoproto.goproto_getters) = false; | ||
|
||
// address is the address of the validator. | ||
string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; | ||
|
||
// power defines the power of the validator. | ||
int64 power = 2; | ||
} |
Oops, something went wrong.