types

package
v4.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeApproveShares  = "approve_shares"
	EventTypeTransferShares = "transfer_shares"

	AttributeKeyOwner     = "owner"
	AttributeKeySpender   = "spender"
	AttributeKeyShares    = "shares"
	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 ValidateGenesisStateAllowances

func ValidateGenesisStateAllowances(allowances []Allowance) error

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) Descriptor() ([]byte, []int)

func (*Allowance) GetOwnerAddress

func (m *Allowance) GetOwnerAddress() string

func (*Allowance) GetSpenderAddress

func (m *Allowance) GetSpenderAddress() string

func (*Allowance) GetValidatorAddress

func (m *Allowance) GetValidatorAddress() string

func (*Allowance) Marshal

func (m *Allowance) Marshal() (dAtA []byte, err error)

func (*Allowance) MarshalTo

func (m *Allowance) MarshalTo(dAtA []byte) (int, error)

func (*Allowance) MarshalToSizedBuffer

func (m *Allowance) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Allowance) ProtoMessage

func (*Allowance) ProtoMessage()

func (*Allowance) Reset

func (m *Allowance) Reset()

func (*Allowance) Size

func (m *Allowance) Size() (n int)

func (*Allowance) String

func (m *Allowance) String() string

func (*Allowance) Unmarshal

func (m *Allowance) Unmarshal(dAtA []byte) error

func (Allowance) Validate

func (a Allowance) Validate() error

func (*Allowance) XXX_DiscardUnknown

func (m *Allowance) XXX_DiscardUnknown()

func (*Allowance) XXX_Marshal

func (m *Allowance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Allowance) XXX_Merge

func (m *Allowance) XXX_Merge(src proto.Message)

func (*Allowance) XXX_Size

func (m *Allowance) XXX_Size() int

func (*Allowance) XXX_Unmarshal

func (m *Allowance) XXX_Unmarshal(b []byte) error

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) MarshalTo

func (m *GenesisState) MarshalTo(dAtA []byte) (int, 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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL