Skip to content

Commit

Permalink
chore: port across custom staking module from cosmos-sdk fork
Browse files Browse the repository at this point in the history
  • Loading branch information
cmwaters committed Jul 26, 2023
1 parent 47b6109 commit bdb6c70
Show file tree
Hide file tree
Showing 117 changed files with 45,256 additions and 0 deletions.
47 changes: 47 additions & 0 deletions proto/celestia/staking/v1beta1/authz.proto
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;
}
49 changes: 49 additions & 0 deletions proto/celestia/staking/v1beta1/genesis.proto
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;
}
Loading

0 comments on commit bdb6c70

Please sign in to comment.