Documentation ¶
Index ¶
- Constants
- Variables
- func GetAllowanceKey(valAddr sdk.ValAddress, owner, spender sdk.AccAddress) []byte
- func ValidateGenesis(data *GenesisState) error
- func ValidateGenesisStateAllowances(allowances []Allowance) error
- func ValidateGenesisStateValidators(validators []stakingtypes.Validator) error
- type Allowance
- func (*Allowance) Descriptor() ([]byte, []int)
- func (m *Allowance) GetOwnerAddress() string
- func (m *Allowance) GetSpenderAddress() string
- func (m *Allowance) GetValidatorAddress() string
- func (m *Allowance) Marshal() (dAtA []byte, err error)
- func (m *Allowance) MarshalTo(dAtA []byte) (int, error)
- func (m *Allowance) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Allowance) ProtoMessage()
- func (m *Allowance) Reset()
- func (m *Allowance) Size() (n int)
- func (m *Allowance) String() string
- func (m *Allowance) Unmarshal(dAtA []byte) error
- func (a Allowance) Validate() error
- func (m *Allowance) XXX_DiscardUnknown()
- func (m *Allowance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Allowance) XXX_Merge(src proto.Message)
- func (m *Allowance) XXX_Size() int
- func (m *Allowance) XXX_Unmarshal(b []byte) error
- type Allowances
- type GenesisState
- func (*GenesisState) Descriptor() ([]byte, []int)
- func (m *GenesisState) GetAllowances() []Allowance
- func (m *GenesisState) GetDelegations() []types.Delegation
- func (m *GenesisState) GetExported() bool
- func (m *GenesisState) GetLastValidatorPowers() []types.LastValidatorPower
- func (m *GenesisState) GetParams() types.Params
- func (m *GenesisState) GetRedelegations() []types.Redelegation
- func (m *GenesisState) GetUnbondingDelegations() []types.UnbondingDelegation
- func (m *GenesisState) GetValidators() []types.Validator
- func (m *GenesisState) Marshal() (dAtA []byte, err error)
- func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)
- func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GenesisState) ProtoMessage()
- func (m *GenesisState) Reset()
- func (m *GenesisState) Size() (n int)
- func (m *GenesisState) String() string
- func (m *GenesisState) Unmarshal(dAtA []byte) error
- func (g GenesisState) UnpackInterfaces(c codectypes.AnyUnpacker) error
- func (m *GenesisState) XXX_DiscardUnknown()
- func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GenesisState) XXX_Merge(src proto.Message)
- func (m *GenesisState) XXX_Size() int
- func (m *GenesisState) XXX_Unmarshal(b []byte) error
Constants ¶
View Source
const ( AttributeKeyOwner = "owner" AttributeKeySpender = "spender" AttributeKeyAmount = "amount" AttributeKeyFrom = "from" AttributeKeyRecipient = "recipient" )
Variables ¶
View Source
var ( ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") )
View Source
var AllowanceKey = []byte{0x90}
Functions ¶
func GetAllowanceKey ¶
func GetAllowanceKey(valAddr sdk.ValAddress, owner, spender sdk.AccAddress) []byte
func ValidateGenesis ¶
func ValidateGenesis(data *GenesisState) error
ValidateGenesis validates the provided staking genesis state to ensure the expected invariants holds. (i.e. params in correct bounds, no duplicate validators)
func ValidateGenesisStateValidators ¶
func ValidateGenesisStateValidators(validators []stakingtypes.Validator) error
Types ¶
type Allowance ¶
type Allowance struct { // validator_address defines the validator address. ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` // owner_address defines the owner address. OwnerAddress string `protobuf:"bytes,2,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` // spender_address defines the spender address. SpenderAddress string `protobuf:"bytes,3,opt,name=spender_address,json=spenderAddress,proto3" json:"spender_address,omitempty"` // allowance defines the amount of shares. Allowance github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=allowance,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"allowance"` }
Allowance defines the allowance of shares for a delegator.
func (*Allowance) Descriptor ¶
func (*Allowance) GetOwnerAddress ¶
func (*Allowance) GetSpenderAddress ¶
func (*Allowance) GetValidatorAddress ¶
func (*Allowance) MarshalToSizedBuffer ¶
func (*Allowance) ProtoMessage ¶
func (*Allowance) ProtoMessage()
func (*Allowance) XXX_DiscardUnknown ¶
func (m *Allowance) XXX_DiscardUnknown()
func (*Allowance) XXX_Marshal ¶
func (*Allowance) XXX_Unmarshal ¶
type Allowances ¶
type Allowances []Allowance
func (Allowances) Len ¶
func (a Allowances) Len() int
func (Allowances) Less ¶
func (a Allowances) Less(i, j int) bool
func (Allowances) Swap ¶
func (a Allowances) Swap(i, j int)
type GenesisState ¶
type GenesisState struct { // params defines all the paramaters of related to deposit. Params types.Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` // last_total_power tracks the total amounts of bonded tokens recorded during // the previous end block. LastTotalPower github_com_cosmos_cosmos_sdk_types.Int `` /* 145-byte string literal not displayed */ // last_validator_powers is a special index that provides a historical list // of the last-block's bonded validators. LastValidatorPowers []types.LastValidatorPower `protobuf:"bytes,3,rep,name=last_validator_powers,json=lastValidatorPowers,proto3" json:"last_validator_powers"` // delegations defines the validator set at genesis. Validators []types.Validator `protobuf:"bytes,4,rep,name=validators,proto3" json:"validators"` // delegations defines the delegations active at genesis. Delegations []types.Delegation `protobuf:"bytes,5,rep,name=delegations,proto3" json:"delegations"` // unbonding_delegations defines the unbonding delegations active at genesis. UnbondingDelegations []types.UnbondingDelegation `protobuf:"bytes,6,rep,name=unbonding_delegations,json=unbondingDelegations,proto3" json:"unbonding_delegations"` // redelegations defines the redelegations active at genesis. Redelegations []types.Redelegation `protobuf:"bytes,7,rep,name=redelegations,proto3" json:"redelegations"` Exported bool `protobuf:"varint,8,opt,name=exported,proto3" json:"exported,omitempty"` // allowances defines the shares allowances active at genesis. Allowances []Allowance `protobuf:"bytes,9,rep,name=allowances,proto3" json:"allowances"` }
GenesisState defines the staking module's genesis state.
func DefaultGenesisState ¶
func DefaultGenesisState() *GenesisState
DefaultGenesisState gets the raw genesis raw message for testing
func NewGenesisState ¶
func NewGenesisState(params stakingtypes.Params, validators []stakingtypes.Validator, delegations []stakingtypes.Delegation) *GenesisState
NewGenesisState creates a new GenesisState instanc e
func (*GenesisState) Descriptor ¶
func (*GenesisState) Descriptor() ([]byte, []int)
func (*GenesisState) GetAllowances ¶
func (m *GenesisState) GetAllowances() []Allowance
func (*GenesisState) GetDelegations ¶
func (m *GenesisState) GetDelegations() []types.Delegation
func (*GenesisState) GetExported ¶
func (m *GenesisState) GetExported() bool
func (*GenesisState) GetLastValidatorPowers ¶
func (m *GenesisState) GetLastValidatorPowers() []types.LastValidatorPower
func (*GenesisState) GetParams ¶
func (m *GenesisState) GetParams() types.Params
func (*GenesisState) GetRedelegations ¶
func (m *GenesisState) GetRedelegations() []types.Redelegation
func (*GenesisState) GetUnbondingDelegations ¶
func (m *GenesisState) GetUnbondingDelegations() []types.UnbondingDelegation
func (*GenesisState) GetValidators ¶
func (m *GenesisState) GetValidators() []types.Validator
func (*GenesisState) Marshal ¶
func (m *GenesisState) Marshal() (dAtA []byte, err error)
func (*GenesisState) MarshalToSizedBuffer ¶
func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GenesisState) ProtoMessage ¶
func (*GenesisState) ProtoMessage()
func (*GenesisState) Reset ¶
func (m *GenesisState) Reset()
func (*GenesisState) Size ¶
func (m *GenesisState) Size() (n int)
func (*GenesisState) String ¶
func (m *GenesisState) String() string
func (*GenesisState) Unmarshal ¶
func (m *GenesisState) Unmarshal(dAtA []byte) error
func (GenesisState) UnpackInterfaces ¶
func (g GenesisState) UnpackInterfaces(c codectypes.AnyUnpacker) error
UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces
func (*GenesisState) XXX_DiscardUnknown ¶
func (m *GenesisState) XXX_DiscardUnknown()
func (*GenesisState) XXX_Marshal ¶
func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GenesisState) XXX_Merge ¶
func (m *GenesisState) XXX_Merge(src proto.Message)
func (*GenesisState) XXX_Size ¶
func (m *GenesisState) XXX_Size() int
func (*GenesisState) XXX_Unmarshal ¶
func (m *GenesisState) XXX_Unmarshal(b []byte) error
Click to show internal directories.
Click to hide internal directories.