types

package
v0.0.0-...-4955b9a Latest Latest
Warning

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

Go to latest
Published: May 31, 2021 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeCompleteUnstaking = "complete_unstaking"
	EventTypeCreateApplication = "create_application"
	EventTypeStake             = "stake"
	EventTypeBeginUnstake      = "begin_unstake"
	EventTypeUnstake           = "unstake"
	AttributeKeyApplication    = "application"
	AttributeValueCategory     = ModuleName
)

pos module event types

View Source
const (
	StakeFee   = 10000
	UnstakeFee = 10000
	UnjailFee  = 10000
)
View Source
const (
	ModuleName   = "application"             // name of module
	StoreKey     = ModuleName                // StoreKey is the string store representation
	TStoreKey    = "transient_" + ModuleName // TStoreKey is the string transient store representation
	QuerierRoute = ModuleName                // QuerierRoute is the querier route for the staking module
	RouterKey    = ModuleName                // RouterKey is the msg router key for the staking module
)
View Source
const (
	MsgAppStakeName   = "app_stake"
	MsgAppUnstakeName = "app_begin_unstake"
	MsgAppUnjailName  = "app_unjail"
)
View Source
const (
	// DefaultParamspace for params keeper
	DefaultParamspace                = ModuleName
	DefaultUnstakingTime             = time.Hour * 24 * 7 * 3
	DefaultMaxApplications     int64 = math.MaxInt64
	DefaultMinStake            int64 = 1000000
	DefaultBaseRelaysPerPOKT   int64 = 100
	DefaultStabilityAdjustment int64 = 0
	DefaultParticipationRateOn bool  = false
	DefaultMaxChains           int64 = 15
)

POS params default values

View Source
const (
	QueryApplications    = "applications"
	QueryApplication     = "application"
	QueryAppStakedPool   = "appStakedPool"
	QueryAppUnstakedPool = "appUnstakedPool"
	QueryParameters      = "parameters"
)

query endpoints supported by the staking Querier

View Source
const (
	NetworkIdentifierLength = 2
)
View Source
const (
	StakedPoolName = "application_staked_tokens_pool"
)

names used as root for pool module accounts: StakingPool -> "application_staked_tokens_pool"

Variables

View Source
var (
	ErrInvalidLengthApps        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowApps          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupApps = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	AllApplicationsKey = []byte{0x01} // prefix for each key to a application
	StakedAppsKey      = []byte{0x02} // prefix for each key to a staked application index, sorted by power
	UnstakingAppsKey   = []byte{0x03} // prefix for unstaking application
	BurnApplicationKey = []byte{0x04} // prefix for awarding applications
)
View Source
var (
	ErrInvalidLengthMsg        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMsg          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupMsg = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	KeyUnstakingTime       = []byte("AppUnstakingTime")
	KeyMaxApplications     = []byte("MaxApplications")
	KeyApplicationMinStake = []byte("ApplicationStakeMinimum")
	BaseRelaysPerPOKT      = []byte("BaseRelaysPerPOKT")
	StabilityAdjustment    = []byte("StabilityAdjustment")
	ParticipationRateOn    = []byte("ParticipationRateOn")
	KeyMaximumChains       = []byte("MaximumChains")
)

Keys for parameter access

View Source
var (
	AppFeeMap = map[string]int64{
		MsgAppStakeName:   StakeFee,
		MsgAppUnstakeName: UnstakeFee,
		MsgAppUnjailName:  UnjailFee,
	}
)
View Source
var ApplicationCacheSize int64 = 5
View Source
var ModuleCdc *codec.Codec

module wide codec

Functions

func AddressFromKey

func AddressFromKey(key []byte) []byte

Removes the prefix bytes from a key to expose true address

func ErrApplicationJailed

func ErrApplicationJailed(codespace sdk.CodespaceType) sdk.Error

func ErrApplicationNotJailed

func ErrApplicationNotJailed(codespace sdk.CodespaceType) sdk.Error

func ErrApplicationPubKeyExists

func ErrApplicationPubKeyExists(codespace sdk.CodespaceType) sdk.Error

func ErrApplicationPubKeyTypeNotSupported

func ErrApplicationPubKeyTypeNotSupported(codespace sdk.CodespaceType, keyType string, supportedTypes []string) sdk.Error

func ErrApplicationStatus

func ErrApplicationStatus(codespace sdk.CodespaceType) sdk.Error

func ErrBadApplicationAddr

func ErrBadApplicationAddr(codespace sdk.CodespaceType) sdk.Error

func ErrBadStakeAmount

func ErrBadStakeAmount(codespace sdk.CodespaceType) sdk.Error

func ErrInvalidNetworkIdentifier

func ErrInvalidNetworkIdentifier(codespace sdk.CodespaceType, err error) sdk.Error

func ErrMaxApplications

func ErrMaxApplications(codespace sdk.CodespaceType) sdk.Error

func ErrMinimumEditStake

func ErrMinimumEditStake(codespace sdk.CodespaceType) sdk.Error

func ErrMinimumStake

func ErrMinimumStake(codespace sdk.CodespaceType) sdk.Error

func ErrMissingAppStake

func ErrMissingAppStake(codespace sdk.CodespaceType) sdk.Error

func ErrNilApplicationAddr

func ErrNilApplicationAddr(codespace sdk.CodespaceType) sdk.Error

func ErrNoApplicationForAddress

func ErrNoApplicationForAddress(codespace sdk.CodespaceType) sdk.Error

func ErrNoApplicationFound

func ErrNoApplicationFound(codespace sdk.CodespaceType) sdk.Error

func ErrNoChains

func ErrNoChains(codespace sdk.CodespaceType) sdk.Error

func ErrNotEnoughCoins

func ErrNotEnoughCoins(codespace sdk.CodespaceType) sdk.Error

func ErrStakeTooLow

func ErrStakeTooLow(codespace sdk.CodespaceType) sdk.Error

func ErrTooManyChains

func ErrTooManyChains(Codespace sdk.CodespaceType) sdk.Error

func InitConfig

func InitConfig(applicationCacheSize int64)

func KeyForAppBurn

func KeyForAppBurn(address sdk.Address) []byte

func KeyForAppByAllApps

func KeyForAppByAllApps(addr sdk.Address) []byte

generates the key for the application with address

func KeyForAppInStakingSet

func KeyForAppInStakingSet(app Application) []byte

generates the key for a application in the staking set

func KeyForUnstakingApps

func KeyForUnstakingApps(unstakingTime time.Time) []byte

generates the key for unstaking applications by the unstakingtime

func MarshalApplication

func MarshalApplication(cdc *codec.Codec, ctx sdk.Ctx, application Application) (result []byte, err error)

unmarshal the application

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete types on the codec

func ValidateNetworkIdentifier

func ValidateNetworkIdentifier(chain string) sdk.Error

Types

type Application

type Application struct {
	Address                 sdk.Address      `json:"address" yaml:"address"`               // address of the application; hex encoded in JSON
	PublicKey               crypto.PublicKey `json:"public_key" yaml:"public_key"`         // the public key of the application; hex encoded in JSON
	Jailed                  bool             `json:"jailed" yaml:"jailed"`                 // has the application been jailed from staked status?
	Status                  sdk.StakeStatus  `json:"status" yaml:"status"`                 // application status (staked/unstaking/unstaked)
	Chains                  []string         `json:"chains" yaml:"chains"`                 // requested chains
	StakedTokens            sdk.BigInt       `json:"tokens" yaml:"tokens"`                 // tokens staked in the network
	MaxRelays               sdk.BigInt       `json:"max_relays" yaml:"max_relays"`         // maximum number of relays allowed
	UnstakingCompletionTime time.Time        `json:"unstaking_time" yaml:"unstaking_time"` // if unstaking, min time for the application to complete unstaking
}

Application represents a pocket network decentralized application. Applications stake in the network for relay throughput.

func NewApplication

func NewApplication(addr sdk.Address, publicKey crypto.PublicKey, chains []string, tokensToStake sdk.BigInt) Application

NewApplication - initialize a new instance of an application

func UnmarshalApplication

func UnmarshalApplication(cdc *codec.Codec, ctx sdk.Ctx, appBytes []byte) (application Application, err error)

unmarshal the application

func (Application) AddStakedTokens

func (a Application) AddStakedTokens(tokens sdk.BigInt) (Application, error)

AddStakedTokens tokens to staked field for a application

func (Application) ConsensusPower

func (a Application) ConsensusPower() int64

get the consensus-engine power a reduction of 10^6 from application tokens is applied

func (Application) Equals

func (a Application) Equals(v2 Application) bool

compares the vital fields of two application structures

func (Application) GetAddress

func (a Application) GetAddress() sdk.Address

func (Application) GetChains

func (a Application) GetChains() []string

func (Application) GetConsensusPower

func (a Application) GetConsensusPower() int64

func (Application) GetMaxRelays

func (a Application) GetMaxRelays() sdk.BigInt

func (Application) GetPublicKey

func (a Application) GetPublicKey() crypto.PublicKey

func (Application) GetStatus

func (a Application) GetStatus() sdk.StakeStatus

func (Application) GetTokens

func (a Application) GetTokens() sdk.BigInt

func (Application) IsJailed

func (a Application) IsJailed() bool

func (Application) IsStaked

func (a Application) IsStaked() bool

func (Application) IsUnstaked

func (a Application) IsUnstaked() bool

func (Application) IsUnstaking

func (a Application) IsUnstaking() bool

func (Application) Marshal

func (a Application) Marshal() ([]byte, error)

func (Application) MarshalJSON

func (a Application) MarshalJSON() ([]byte, error)

MarshalJSON marshals the application to JSON using raw Hex for the public key

func (Application) MarshalTo

func (a Application) MarshalTo(data []byte) (n int, err error)

func (Application) MarshalToSizedBuffer

func (a Application) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (Application) ProtoMessage

func (a Application) ProtoMessage()

func (Application) RemoveStakedTokens

func (a Application) RemoveStakedTokens(tokens sdk.BigInt) (Application, error)

RemoveStakedTokens removes tokens from a application

func (*Application) Reset

func (a *Application) Reset()

func (Application) Size

func (a Application) Size() int

func (Application) String

func (a Application) String() string

String returns a human readable string representation of a application.

func (Application) ToProto

func (a Application) ToProto() ProtoApplication

func (*Application) Unmarshal

func (a *Application) Unmarshal(data []byte) (err error)

func (*Application) UnmarshalJSON

func (a *Application) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the application from JSON using raw hex for the public key

func (Application) UpdateStatus

func (a Application) UpdateStatus(newStatus sdk.StakeStatus) Application

UpdateStatus updates the staking status

type ApplicationSet

type ApplicationSet interface {
	// iterate through applications by address, execute func for each application
	IterateAndExecuteOverApps(sdk.Ctx, func(index int64, application appexported.ApplicationI) (stop bool))
	// iterate through staked applications by address, execute func for each application
	IterateAndExecuteOverStakedApps(sdk.Ctx, func(index int64, application appexported.ApplicationI) (stop bool))
	// get a particular application by address
	Application(sdk.Ctx, sdk.Address) appexported.ApplicationI
	// total staked tokens within the application set
	TotalTokens(sdk.Ctx) sdk.BigInt
	// jail a application
	JailApplication(sdk.Ctx, sdk.Address)
	// unjail a application
	UnjailApplication(sdk.Ctx, sdk.Address)
	// MaxApplications returns the maximum amount of staked applications
	MaxApplications(sdk.Ctx) int64
}

ApplicationSet expected properties for the set of all applications (noalias)

type Applications

type Applications []Application

Applications is a slice of type application.

func (Applications) JSON

func (a Applications) JSON() (out []byte, err error)

marshal structure into JSON encoding

func (Applications) String

func (a Applications) String() (out string)

type ApplicationsPage

type ApplicationsPage struct {
	Result Applications `json:"result"`
	Total  int          `json:"total_pages"`
	Page   int          `json:"page"`
}

func (ApplicationsPage) String

func (aP ApplicationsPage) String() string

String returns a human readable string representation of a validator page

type AuthKeeper

type AuthKeeper interface {
	// get total supply of tokens
	GetSupply(ctx sdk.Ctx) authexported.SupplyI
	// set total supply of tokens
	SetSupply(ctx sdk.Ctx, supply authexported.SupplyI)
	// get the address of a module account
	GetModuleAddress(name string) sdk.Address
	// get the module account structure
	GetModuleAccount(ctx sdk.Ctx, moduleName string) authexported.ModuleAccountI
	// set module account structure
	SetModuleAccount(sdk.Ctx, authexported.ModuleAccountI)
	// send coins to/from module accounts
	SendCoinsFromModuleToModule(ctx sdk.Ctx, senderModule, recipientModule string, amt sdk.Coins) sdk.Error
	// send coins from module to validator
	SendCoinsFromModuleToAccount(ctx sdk.Ctx, senderModule string, recipientAddr sdk.Address, amt sdk.Coins) sdk.Error
	// send coins from validator to module
	SendCoinsFromAccountToModule(ctx sdk.Ctx, senderAddr sdk.Address, recipientModule string, amt sdk.Coins) sdk.Error
	// mint coins
	MintCoins(ctx sdk.Ctx, moduleName string, amt sdk.Coins) sdk.Error
	// burn coins
	BurnCoins(ctx sdk.Ctx, name string, amt sdk.Coins) sdk.Error
	// iterate accounts
	IterateAccounts(ctx sdk.Ctx, process func(authexported.Account) (stop bool))
	// get coins
	GetCoins(ctx sdk.Ctx, addr sdk.Address) sdk.Coins
	// set coins
	SetCoins(ctx sdk.Ctx, addr sdk.Address, amt sdk.Coins) sdk.Error
	// has coins
	HasCoins(ctx sdk.Ctx, addr sdk.Address, amt sdk.Coins) bool
	// send coins
	SendCoins(ctx sdk.Ctx, fromAddr sdk.Address, toAddr sdk.Address, amt sdk.Coins) sdk.Error
}

AuthKeeper defines the expected supply Keeper (noalias)

type CodeType

type CodeType = sdk.CodeType
const (
	DefaultCodespace          sdk.CodespaceType = ModuleName
	CodeInvalidApplication    CodeType          = 101
	CodeInvalidInput          CodeType          = 103
	CodeApplicationJailed     CodeType          = 104
	CodeApplicationNotJailed  CodeType          = 105
	CodeMissingSelfDelegation CodeType          = 106
	CodeInvalidStatus         CodeType          = 110
	CodeMinimumStake          CodeType          = 111
	CodeNotEnoughCoins        CodeType          = 112
	CodeInvalidStakeAmount    CodeType          = 115
	CodeNoChains              CodeType          = 116
	CodeInvalidNetworkID      CodeType          = 117
	CodeTooManyChains         CodeType          = 118
	CodeMaxApplications       CodeType          = 119
	CodeMinimumEditStake      CodeType          = 120
)

type GenesisState

type GenesisState struct {
	Params       Params       `json:"params" yaml:"params"`
	Applications Applications `json:"applications" yaml:"applications"`
	Exported     bool         `json:"exported" yaml:"exported"`
}

GenesisState - all staking state that must be provided at genesis

func DefaultGenesisState

func DefaultGenesisState() GenesisState

get raw genesis raw message for testing

type JSONApplication

type JSONApplication struct {
	Address                 sdk.Address     `json:"address" yaml:"address"`               // the hex address of the application
	PublicKey               string          `json:"public_key" yaml:"public_key"`         // the hex consensus public key of the application
	Jailed                  bool            `json:"jailed" yaml:"jailed"`                 // has the application been jailed from staked status?
	Chains                  []string        `json:"chains" yaml:"chains"`                 // non native (external) blockchains needed for the application
	MaxRelays               sdk.BigInt      `json:"max_relays" yaml:"max_relays"`         // maximum number of relays allowed for the application
	Status                  sdk.StakeStatus `json:"status" yaml:"status"`                 // application status (staked/unstaking/unstaked)
	StakedTokens            sdk.BigInt      `json:"staked_tokens" yaml:"staked_tokens"`   // how many staked tokens
	UnstakingCompletionTime time.Time       `json:"unstaking_time" yaml:"unstaking_time"` // if unstaking, min time for the application to complete unstaking
}

this is a helper struct used for JSON de- and encoding only

type MsgBeginUnstake

type MsgBeginUnstake struct {
	Address github_com_pokt_network_pocket_core_types.Address `` /* 155-byte string literal not displayed */
}

func (*MsgBeginUnstake) Descriptor

func (*MsgBeginUnstake) Descriptor() ([]byte, []int)

func (*MsgBeginUnstake) Equal

func (this *MsgBeginUnstake) Equal(that interface{}) bool

func (MsgBeginUnstake) GetFee

func (msg MsgBeginUnstake) GetFee() sdk.BigInt

GetFee get fee for msg

func (MsgBeginUnstake) GetRecipient

func (msg MsgBeginUnstake) GetRecipient() sdk.Address

func (MsgBeginUnstake) GetSignBytes

func (msg MsgBeginUnstake) GetSignBytes() []byte

GetSignBytes returns the message bytes to sign over.

func (MsgBeginUnstake) GetSigner

func (msg MsgBeginUnstake) GetSigner() sdk.Address

GetSigners address(es) that must sign over msg.GetSignBytes()

func (*MsgBeginUnstake) Marshal

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

func (*MsgBeginUnstake) MarshalTo

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

func (*MsgBeginUnstake) MarshalToSizedBuffer

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

func (*MsgBeginUnstake) ProtoMessage

func (*MsgBeginUnstake) ProtoMessage()

func (*MsgBeginUnstake) Reset

func (m *MsgBeginUnstake) Reset()

func (MsgBeginUnstake) Route

func (msg MsgBeginUnstake) Route() string

Route provides router key for msg

func (*MsgBeginUnstake) Size

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

func (*MsgBeginUnstake) String

func (m *MsgBeginUnstake) String() string

func (MsgBeginUnstake) Type

func (msg MsgBeginUnstake) Type() string

Type provides msg name

func (*MsgBeginUnstake) Unmarshal

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

func (MsgBeginUnstake) ValidateBasic

func (msg MsgBeginUnstake) ValidateBasic() sdk.Error

ValidateBasic quick validity check for staking an application

func (*MsgBeginUnstake) XXX_DiscardUnknown

func (m *MsgBeginUnstake) XXX_DiscardUnknown()

func (*MsgBeginUnstake) XXX_Marshal

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

func (*MsgBeginUnstake) XXX_Merge

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

func (*MsgBeginUnstake) XXX_MessageName

func (*MsgBeginUnstake) XXX_MessageName() string

func (*MsgBeginUnstake) XXX_Size

func (m *MsgBeginUnstake) XXX_Size() int

func (*MsgBeginUnstake) XXX_Unmarshal

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

type MsgProtoStake

type MsgProtoStake struct {
	PubKey []byte                                           `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pubkey" yaml:"pubkey"`
	Chains []string                                         `protobuf:"bytes,2,rep,name=chains,proto3" json:"chains" yaml:"chains"`
	Value  github_com_pokt_network_pocket_core_types.BigInt `` /* 126-byte string literal not displayed */
}

func (*MsgProtoStake) Descriptor

func (*MsgProtoStake) Descriptor() ([]byte, []int)

func (*MsgProtoStake) Equal

func (this *MsgProtoStake) Equal(that interface{}) bool

func (*MsgProtoStake) Marshal

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

func (*MsgProtoStake) MarshalTo

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

func (*MsgProtoStake) MarshalToSizedBuffer

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

func (*MsgProtoStake) ProtoMessage

func (*MsgProtoStake) ProtoMessage()

func (*MsgProtoStake) Reset

func (m *MsgProtoStake) Reset()

func (*MsgProtoStake) Size

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

func (*MsgProtoStake) String

func (m *MsgProtoStake) String() string

func (*MsgProtoStake) Unmarshal

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

func (*MsgProtoStake) XXX_DiscardUnknown

func (m *MsgProtoStake) XXX_DiscardUnknown()

func (*MsgProtoStake) XXX_Marshal

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

func (*MsgProtoStake) XXX_Merge

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

func (*MsgProtoStake) XXX_MessageName

func (*MsgProtoStake) XXX_MessageName() string

func (*MsgProtoStake) XXX_Size

func (m *MsgProtoStake) XXX_Size() int

func (*MsgProtoStake) XXX_Unmarshal

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

type MsgStake

type MsgStake struct {
	PubKey crypto.PublicKey `json:"pubkey" yaml:"pubkey"`
	Chains []string         `json:"chains" yaml:"chains"`
	Value  sdk.BigInt       `json:"value" yaml:"value"`
}

func (MsgStake) GetFee

func (msg MsgStake) GetFee() sdk.BigInt

GetFee get fee for msg

func (MsgStake) GetRecipient

func (msg MsgStake) GetRecipient() sdk.Address

func (MsgStake) GetSignBytes

func (msg MsgStake) GetSignBytes() []byte

GetSignBytes returns the message bytes to sign over.

func (MsgStake) GetSigner

func (msg MsgStake) GetSigner() sdk.Address

GetSigners return address(es) that must sign over msg.GetSignBytes()

func (*MsgStake) Marshal

func (msg *MsgStake) Marshal() ([]byte, error)

func (*MsgStake) MarshalTo

func (msg *MsgStake) MarshalTo(data []byte) (n int, err error)

func (*MsgStake) MarshalToSizedBuffer

func (msg *MsgStake) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (MsgStake) ProtoMessage

func (msg MsgStake) ProtoMessage()

func (*MsgStake) Reset

func (msg *MsgStake) Reset()

func (MsgStake) Route

func (msg MsgStake) Route() string

Route provides router key for msg

func (*MsgStake) Size

func (msg *MsgStake) Size() int

func (MsgStake) String

func (msg MsgStake) String() string

func (MsgStake) ToProto

func (msg MsgStake) ToProto() MsgProtoStake

func (MsgStake) Type

func (msg MsgStake) Type() string

Type provides msg name

func (*MsgStake) Unmarshal

func (msg *MsgStake) Unmarshal(data []byte) error

func (MsgStake) ValidateBasic

func (msg MsgStake) ValidateBasic() sdk.Error

ValidateBasic quick validity check for staking an application

func (*MsgStake) XXX_MessageName

func (msg *MsgStake) XXX_MessageName() string

type MsgUnjail

type MsgUnjail struct {
	AppAddr github_com_pokt_network_pocket_core_types.Address `` /* 131-byte string literal not displayed */
}

func (*MsgUnjail) Descriptor

func (*MsgUnjail) Descriptor() ([]byte, []int)

func (*MsgUnjail) Equal

func (this *MsgUnjail) Equal(that interface{}) bool

func (MsgUnjail) GetFee

func (msg MsgUnjail) GetFee() sdk.BigInt

GetFee get fee for msg

func (MsgUnjail) GetRecipient

func (msg MsgUnjail) GetRecipient() sdk.Address

func (MsgUnjail) GetSignBytes

func (msg MsgUnjail) GetSignBytes() []byte

GetSignBytes returns the message bytes to sign over.

func (MsgUnjail) GetSigner

func (msg MsgUnjail) GetSigner() sdk.Address

GetSigners return address(es) that must sign over msg.GetSignBytes()

func (*MsgUnjail) Marshal

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

func (*MsgUnjail) MarshalTo

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

func (*MsgUnjail) MarshalToSizedBuffer

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

func (*MsgUnjail) ProtoMessage

func (*MsgUnjail) ProtoMessage()

func (*MsgUnjail) Reset

func (m *MsgUnjail) Reset()

func (MsgUnjail) Route

func (msg MsgUnjail) Route() string

---------------------------------------------------------------------------------------------------------------------- Route provides router key for msg

func (*MsgUnjail) Size

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

func (*MsgUnjail) String

func (m *MsgUnjail) String() string

func (MsgUnjail) Type

func (msg MsgUnjail) Type() string

Type provides msg name

func (*MsgUnjail) Unmarshal

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

func (MsgUnjail) ValidateBasic

func (msg MsgUnjail) ValidateBasic() sdk.Error

ValidateBasic quick validity check for staking an application

func (*MsgUnjail) XXX_DiscardUnknown

func (m *MsgUnjail) XXX_DiscardUnknown()

func (*MsgUnjail) XXX_Marshal

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

func (*MsgUnjail) XXX_Merge

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

func (*MsgUnjail) XXX_MessageName

func (*MsgUnjail) XXX_MessageName() string

func (*MsgUnjail) XXX_Size

func (m *MsgUnjail) XXX_Size() int

func (*MsgUnjail) XXX_Unmarshal

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

type Params

type Params struct {
	UnstakingTime       time.Duration `json:"unstaking_time" yaml:"unstaking_time"`               // duration of unstaking
	MaxApplications     int64         `json:"max_applications" yaml:"max_applications"`           // maximum number of applications
	AppStakeMin         int64         `json:"app_stake_minimum" yaml:"app_stake_minimum"`         // minimum amount needed to stake as an application
	BaseRelaysPerPOKT   int64         `json:"base_relays_per_pokt" yaml:"base_relays_per_pokt"`   // base relays per POKT coin staked
	StabilityAdjustment int64         `json:"stability_adjustment" yaml:"stability_adjustment"`   // the stability adjustment from the governance
	ParticipationRateOn bool          `json:"participation_rate_on" yaml:"participation_rate_on"` // the participation rate affects the amount minted based on staked ratio
	MaxChains           int64         `json:"maximum_chains" yaml:"maximum_chains"`               // the maximum number of chains an app can stake for
}

Params defines the high level settings for pos module

func DefaultParams

func DefaultParams() Params

DefaultParams returns a default set of parameters.

func (Params) Equal

func (p Params) Equal(p2 Params) bool

Checks the equality of two param objects

func (*Params) ParamSetPairs

func (p *Params) ParamSetPairs() types.ParamSetPairs

Implements params.ParamSet

func (Params) String

func (p Params) String() string

String returns a human readable string representation of the parameters.

func (Params) Validate

func (p Params) Validate() error

Validate a set of params

type PocketKeeper

type PocketKeeper interface {
	// clear the cache of validators for sessions and relays
	ClearSessionCache()
}

type Pool

type Pool struct {
	Tokens github_com_pokt_network_pocket_core_types.BigInt `protobuf:"bytes,1,opt,name=tokens,proto3,customtype=github.com/pokt-network/pocket-core/types.BigInt" json:"tokens"`
}

Pool - tracking bonded and not-bonded token supply of the bond denomination

func NewPool

func NewPool(tokens sdk.BigInt) Pool

NewPool creates a new Tokens instance used for queries

func (*Pool) Descriptor

func (*Pool) Descriptor() ([]byte, []int)

func (*Pool) Equal

func (this *Pool) Equal(that interface{}) bool

func (*Pool) Marshal

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

func (*Pool) MarshalTo

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

func (*Pool) MarshalToSizedBuffer

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

func (*Pool) ProtoMessage

func (*Pool) ProtoMessage()

func (*Pool) Reset

func (m *Pool) Reset()

func (*Pool) Size

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

func (*Pool) String

func (m *Pool) String() string

func (*Pool) Unmarshal

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

func (*Pool) XXX_DiscardUnknown

func (m *Pool) XXX_DiscardUnknown()

func (*Pool) XXX_Marshal

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

func (*Pool) XXX_Merge

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

func (*Pool) XXX_Size

func (m *Pool) XXX_Size() int

func (*Pool) XXX_Unmarshal

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

type PosKeeper

type PosKeeper interface {
	StakeDenom(ctx sdk.Ctx) (res string)
	// GetStakedTokens total staking tokens supply which is staked
	GetStakedTokens(ctx sdk.Ctx) sdk.BigInt
}

type ProtoApplication

type ProtoApplication struct {
	Address                 github_com_pokt_network_pocket_core_types.Address     `` /* 131-byte string literal not displayed */
	PublicKey               []byte                                                `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key" yaml:"public_key"`
	Jailed                  bool                                                  `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed" yaml:"jailed"`
	Status                  github_com_pokt_network_pocket_core_types.StakeStatus `` /* 133-byte string literal not displayed */
	Chains                  []string                                              `protobuf:"bytes,5,rep,name=chains,proto3" json:"chains" yaml:"chains"`
	StakedTokens            github_com_pokt_network_pocket_core_types.BigInt      `` /* 154-byte string literal not displayed */
	MaxRelays               github_com_pokt_network_pocket_core_types.BigInt      `` /* 156-byte string literal not displayed */
	UnstakingCompletionTime time.Time                                             `` /* 141-byte string literal not displayed */
}

Application defines the total amount of bond shares and their exchange rate to coins. Slashing results in a decrease in the exchange rate, allowing correct calculation of future undelegations without iterating over delegators. When coins are delegated to this validator, the validator is credited with a delegation whose number of bond shares is based on the amount of coins delegated divided by the current exchange rate. Voting power can be calculated as total bonded shares multiplied by exchange rate.

func (*ProtoApplication) Descriptor

func (*ProtoApplication) Descriptor() ([]byte, []int)

func (*ProtoApplication) Equal

func (this *ProtoApplication) Equal(that interface{}) bool

func (ProtoApplication) FromProto

func (ae ProtoApplication) FromProto() (Application, error)

func (*ProtoApplication) Marshal

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

func (*ProtoApplication) MarshalTo

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

func (*ProtoApplication) MarshalToSizedBuffer

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

func (*ProtoApplication) ProtoMessage

func (*ProtoApplication) ProtoMessage()

func (*ProtoApplication) Reset

func (m *ProtoApplication) Reset()

func (*ProtoApplication) Size

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

func (*ProtoApplication) String

func (m *ProtoApplication) String() string

func (*ProtoApplication) Unmarshal

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

func (*ProtoApplication) XXX_DiscardUnknown

func (m *ProtoApplication) XXX_DiscardUnknown()

func (*ProtoApplication) XXX_Marshal

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

func (*ProtoApplication) XXX_Merge

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

func (*ProtoApplication) XXX_Size

func (m *ProtoApplication) XXX_Size() int

func (*ProtoApplication) XXX_Unmarshal

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

type QueryAppParams

type QueryAppParams struct {
	Address sdk.Address
}

func NewQueryAppParams

func NewQueryAppParams(applicationAddr sdk.Address) QueryAppParams

type QueryApplicationsWithOpts

type QueryApplicationsWithOpts struct {
	Page          int             `json:"page"`
	Limit         int             `json:"per_page"`
	StakingStatus sdk.StakeStatus `json:"staking_status"`
	Blockchain    string          `json:"blockchain"`
}

func (QueryApplicationsWithOpts) IsValid

func (opts QueryApplicationsWithOpts) IsValid(app Application) bool

type QueryAppsParams

type QueryAppsParams struct {
	Page, Limit int
}

func NewQueryApplicationsParams

func NewQueryApplicationsParams(page, limit int) QueryAppsParams

type QueryStakedApplicationsParams

type QueryStakedApplicationsParams struct {
	Page, Limit int
}

type QueryUnstakingApplicationsParams

type QueryUnstakingApplicationsParams struct {
	Page, Limit int
}

type StakingPool

type StakingPool Pool

Tokens - tracking staked token supply

func (StakingPool) String

func (bp StakingPool) String() string

String returns a human readable string representation of a pool.

Jump to

Keyboard shortcuts

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