Documentation ¶
Index ¶
- Constants
- Variables
- func GetIndexingNodeKey(nodeAddr sdk.AccAddress) []byte
- func GetIndexingNodeRegistrationVotesKey(nodeAddr sdk.AccAddress) []byte
- func GetLastIndexingNodeStakeKey(nodeAddr sdk.AccAddress) []byte
- func GetLastResourceNodeStakeKey(nodeAddr sdk.AccAddress) []byte
- func GetResourceNodeKey(nodeAddr sdk.AccAddress) []byte
- func GetUBDNodeKey(nodeAddr sdk.AccAddress) []byte
- func GetUBDTimeKey(timestamp time.Time) []byte
- func MustMarshalIndexingNode(cdc *codec.Codec, indexingNode IndexingNode) []byte
- func MustMarshalResourceNode(cdc *codec.Codec, resourceNode ResourceNode) []byte
- func MustMarshalUnbondingNode(cdc *codec.Codec, uin UnbondingNode) []byte
- func ParamKeyTable() params.KeyTable
- func RegisterCodec(cdc *codec.Codec)
- func ValidateGenesis(data GenesisState) error
- type AccountKeeper
- type Bech32PubKeyType
- type Description
- type GenesisIndexingNode
- type GenesisState
- type IndexingNode
- func (v IndexingNode) AddToken(amount sdk.Int) IndexingNode
- func (indexingNode IndexingNode) Equal(indexingNode2 IndexingNode) bool
- func (v IndexingNode) GetCreationTime() time.Time
- func (v IndexingNode) GetMoniker() string
- func (v IndexingNode) GetNetworkAddr() sdk.AccAddress
- func (v IndexingNode) GetNetworkID() string
- func (v IndexingNode) GetOwnerAddr() sdk.AccAddress
- func (v IndexingNode) GetPubKey() crypto.PubKey
- func (v IndexingNode) GetStatus() sdk.BondStatus
- func (v IndexingNode) GetTokens() sdk.Int
- func (v IndexingNode) IsBonded() bool
- func (v IndexingNode) IsSuspended() bool
- func (v IndexingNode) IsUnBonded() bool
- func (v IndexingNode) IsUnBonding() bool
- func (v IndexingNode) String() string
- func (v IndexingNode) SubToken(tokens sdk.Int) IndexingNode
- func (v IndexingNode) Validate() error
- type IndexingNodeRegistrationVotePool
- type IndexingNodes
- type LastIndexingNodeStake
- type LastResourceNodeStake
- type MsgCreateIndexingNode
- type MsgCreateResourceNode
- type MsgIndexingNodeRegistrationVote
- func (m MsgIndexingNodeRegistrationVote) GetSignBytes() []byte
- func (m MsgIndexingNodeRegistrationVote) GetSigners() []sdk.AccAddress
- func (m MsgIndexingNodeRegistrationVote) Route() string
- func (m MsgIndexingNodeRegistrationVote) Type() string
- func (m MsgIndexingNodeRegistrationVote) ValidateBasic() error
- type MsgRemoveIndexingNode
- type MsgRemoveResourceNode
- type MsgUpdateIndexingNode
- type MsgUpdateIndexingNodeStake
- type MsgUpdateResourceNode
- type MsgUpdateResourceNodeStake
- type MultiRegisterHooks
- func (h MultiRegisterHooks) AfterNodeBeginUnbonding(ctx sdk.Context, networkAddr sdk.AccAddress, isIndexingNode bool)
- func (h MultiRegisterHooks) AfterNodeBonded(ctx sdk.Context, networkAddr sdk.AccAddress, isIndexingNode bool)
- func (h MultiRegisterHooks) AfterNodeCreated(ctx sdk.Context, networkAddr sdk.AccAddress, isIndexingNode bool)
- func (h MultiRegisterHooks) AfterNodeRemoved(ctx sdk.Context, networkAddr sdk.AccAddress, isIndexingNode bool)
- func (h MultiRegisterHooks) BeforeNodeModified(ctx sdk.Context, networkAddr sdk.AccAddress, isIndexingNode bool)
- type NodeType
- type NodesStakingInfo
- type ParamSubspace
- type Params
- type QueryNodeStakingParams
- type QueryNodesParams
- type RegisterHooks
- type ResourceNode
- func (v ResourceNode) AddToken(amount sdk.Int) ResourceNode
- func (resourceNode ResourceNode) Equal(resourceNode2 ResourceNode) bool
- func (v ResourceNode) GetCreationTime() time.Time
- func (v ResourceNode) GetMoniker() string
- func (v ResourceNode) GetNetworkAddr() sdk.AccAddress
- func (v ResourceNode) GetNetworkID() string
- func (v ResourceNode) GetNodeType() string
- func (v ResourceNode) GetOwnerAddr() sdk.AccAddress
- func (v ResourceNode) GetPubKey() crypto.PubKey
- func (v ResourceNode) GetStatus() sdk.BondStatus
- func (v ResourceNode) GetTokens() sdk.Int
- func (v ResourceNode) IsBonded() bool
- func (v ResourceNode) IsSuspended() bool
- func (v ResourceNode) IsUnBonded() bool
- func (v ResourceNode) IsUnBonding() bool
- func (v ResourceNode) String() string
- func (v ResourceNode) SubToken(tokens sdk.Int) ResourceNode
- func (v ResourceNode) Validate() error
- type ResourceNodes
- type StakingInfo
- type SupplyKeeper
- type UnbondingNode
- type UnbondingNodeEntry
- type UnbondingNodes
- type VoteOpinion
Constants ¶
const ( EventTypeCompleteUnbondingResourceNode = "complete_unbonding_resource_node" EventTypeCompleteUnbondingIndexingNode = "complete_unbonding_indexing_node" EventTypeUnbondNode = "unbond_node" EventTypeCreateResourceNode = "create_resource_node" EventTypeRemoveResourceNode = "remove_resource_node" EventTypeUnbondingResourceNode = "unbonding_resource_node" EventTypeUpdateResourceNode = "update_resource_node" EventTypeUpdateResourceNodeStake = "update_resource_node_stake" EventTypeCreateIndexingNode = "create_indexing_node" EventTypeRemoveIndexingNode = "remove_indexing_node" EventTypeUnbondingIndexingNode = "unbonding_indexing_node" EventTypeUpdateIndexingNode = "update_indexing_node" EventTypeUpdateIndexingNodeStake = "update_indexing_node_stake" EventTypeIndexingNodeRegistrationVote = "indexing_node_reg_vote" AttributeKeyResourceNode = "resource_node" AttributeKeyIndexingNode = "indexing_node" AttributeKeyNetworkAddress = "network_address" AttributeKeyPubKey = "pub_key" AttributeKeyCandidateNetworkAddress = "candidate_network_address" AttributeKeyVoterNetworkAddress = "voter_network_address" AttributeKeyCandidateStatus = "candidate_status" AttributeKeyNetworkAddr = "network_addr" AttributeKeyIsIndexingNode = "is_indexing_node" AttributeKeyUnbondingMatureTime = "unbonding_mature_time" AttributeKeyOZoneLimitChanges = "ozone_limit_changes" AttributeKeyIncrStakeBool = "incr_stake" AttributeValueCategory = ModuleName )
const ( Approve VoteOpinion = true Reject VoteOpinion = false VoteOpinionApprove = "Approve" VoteOpinionReject = "Reject" )
const ( Bech32PubKeyTypesdsPub Bech32PubKeyType = "sdspub" // ModuleName is the name of the module ModuleName = "register" // StoreKey to be used when creating the KVStore StoreKey = ModuleName // RouterKey to be used for routing msgs RouterKey = ModuleName // QuerierRoute to be used for querier msgs QuerierRoute = ModuleName )
const ( DefaultParamSpace = ModuleName DefaultBondDenom = "ustos" DefaultUnbondingThreasholdTime time.Duration = 180 * 24 * time.Hour // threashold for unbonding - by default 180 days DefaultUnbondingCompletionTime time.Duration = 14 * 24 * time.Hour // lead time to complete unbonding - by default 14 days DefaultMaxEntries = uint16(16) )
Default parameter namespace
const ( QueryType_All = 0 QueryType_SP = 1 QueryType_PP = 2 )
const ( // TODO: Why can't we just have one string description which can be JSON by convention MaxMonikerLength = 70 MaxIdentityLength = 3000 MaxWebsiteLength = 140 MaxSecurityContactLength = 140 MaxDetailsLength = 280 )
nolint
Variables ¶
var ( ErrInvalid = sdkerrors.Register(ModuleName, 1, "error invalid") ErrEmptyNetworkAddr = sdkerrors.Register(ModuleName, 2, "missing network address") ErrEmptyOwnerAddr = sdkerrors.Register(ModuleName, 3, "missing owner address") ErrValueNegative = sdkerrors.Register(ModuleName, 4, "value must be positive") ErrEmptyDescription = sdkerrors.Register(ModuleName, 5, "description must be not empty") ErrEmptyMoniker = sdkerrors.Register(ModuleName, 6, "moniker must be not empty") ErrEmptyResourceNodeAddr = sdkerrors.Register(ModuleName, 7, "missing resource node address") ErrEmptyIndexingNodeAddr = sdkerrors.Register(ModuleName, 8, "missing indexing node address") ErrBadDenom = sdkerrors.Register(ModuleName, 9, "invalid coin denomination") ErrResourceNodePubKeyExists = sdkerrors.Register(ModuleName, 10, "resource node already exist for this pubkey; must use new resource node pubkey") ErrIndexingNodePubKeyExists = sdkerrors.Register(ModuleName, 11, "indexing node already exist for this pubkey; must use new indexing node pubkey") ErrNoResourceNodeFound = sdkerrors.Register(ModuleName, 12, "resource node does not exist") ErrNoIndexingNodeFound = sdkerrors.Register(ModuleName, 13, "indexing node does not exist") ErrNoOwnerAccountFound = sdkerrors.Register(ModuleName, 14, "account of owner does not exist") ErrInsufficientBalance = sdkerrors.Register(ModuleName, 15, "insufficient balance") ErrNodeType = sdkerrors.Register(ModuleName, 16, "node type(s) not supported") ErrEmptyCandidateNetworkAddr = sdkerrors.Register(ModuleName, 17, "missing candidate network address") ErrEmptyCandidateOwnerAddr = sdkerrors.Register(ModuleName, 18, "missing candidate owner address") ErrEmptyVoterNetworkAddr = sdkerrors.Register(ModuleName, 19, "missing voter network address") ErrEmptyVoterOwnerAddr = sdkerrors.Register(ModuleName, 20, "missing voter owner address") ErrSameAddr = sdkerrors.Register(ModuleName, 21, "node address should not same as the voter address") ErrInvalidOwnerAddr = sdkerrors.Register(ModuleName, 22, "invalid owner address") ErrInvalidVoterAddr = sdkerrors.Register(ModuleName, 23, "invalid voter address") ErrInvalidVoterStatus = sdkerrors.Register(ModuleName, 24, "invalid voter status") ErrNoRegistrationVotePoolFound = sdkerrors.Register(ModuleName, 25, "registration pool does not exist") ErrDuplicateVoting = sdkerrors.Register(ModuleName, 26, "duplicate voting") ErrVoteExpired = sdkerrors.Register(ModuleName, 27, "vote expired") ErrInsufficientBalanceOfBondedPool = sdkerrors.Register(ModuleName, 28, "insufficient balance of bonded pool") ErrInsufficientBalanceOfNotBondedPool = sdkerrors.Register(ModuleName, 29, "insufficient balance of not bonded pool") ErrSubAllTokens = sdkerrors.Register(ModuleName, 30, "can not sub all tokens since the node is still bonded") ErrED25519InvalidPubKey = sdkerrors.Register(ModuleName, 31, "ED25519 public keys are unsupported") ErrEmptyNodeId = sdkerrors.Register(ModuleName, 32, "missing node id") ErrEmptyPubKey = sdkerrors.Register(ModuleName, 33, "missing public key") ErrInvalidGenesisToken = sdkerrors.Register(ModuleName, 34, "invalid genesis token") ErrNoUnbondingNode = sdkerrors.Register(ModuleName, 35, "no unbonding node found") ErrMaxUnbondingNodeEntries = sdkerrors.Register(ModuleName, 36, "too many unbonding node entries for networkAddr tuple") ErrNoNodeForAddress = sdkerrors.Register(ModuleName, 37, "registered node does not contain address") ErrUnbondingNode = sdkerrors.Register(ModuleName, 38, "changes cannot be made to an unbonding node") ErrInvalidNodeStatBonded = sdkerrors.Register(ModuleName, 39, "invalid node status: bonded") ErrInitialUOzonePrice = sdkerrors.Register(ModuleName, 40, "initial uOzone price must be positive") ErrInvalidStakeChange = sdkerrors.Register(ModuleName, 41, "invalid change for stake") )
var ( ResourceNodeNotBondedTokenKey = []byte{0x01} ResourceNodeBondedTokenKey = []byte{0x02} IndexingNodeNotBondedTokenKey = []byte{0x03} IndexingNodeBondedTokenKey = []byte{0x04} UpperBoundOfTotalOzoneKey = []byte{0x05} LastResourceNodeStakeKey = []byte{0x11} // prefix for each key to a resource node index, for bonded resource nodes LastIndexingNodeStakeKey = []byte{0x12} // prefix for each key to a indexing node index, for bonded indexing nodes InitialGenesisStakeTotalKey = []byte{0x13} // key of initial genesis deposit by all resource nodes and meta nodes at t=0 InitialUOzonePriceKey = []byte{0x14} // key of initial uoz price at t=0 ResourceNodeKey = []byte{0x21} // prefix for each key to a resource node IndexingNodeKey = []byte{0x22} // prefix for each key to a indexing node IndexingNodeRegistrationVotesKey = []byte{0x23} // prefix for each key to the vote for Indexing node registration UBDNodeKey = []byte{0x31} // prefix for each key to an unbonding node UBDNodeQueueKey = []byte{0x41} // prefix for the timestamps in unbonding node queue )
var ( KeyBondDenom = []byte("BondDenom") KeyUnbondingThreasholdTime = []byte("UnbondingThreasholdTime") KeyUnbondingCompletionTime = []byte("UnbondingCompletionTime") KeyMaxEntries = []byte("KeyMaxEntries") DefaultUozPrice = sdk.NewDecWithPrec(1000000, 9) // 0.001 ustos -> 1 uoz )
Parameter store keys
var ModuleCdc *codec.Codec
ModuleCdc defines the module codec
Functions ¶
func GetIndexingNodeKey ¶
func GetIndexingNodeKey(nodeAddr sdk.AccAddress) []byte
GetIndexingNodeKey gets the key for the indexingNode with address VALUE: ResourceNode
func GetIndexingNodeRegistrationVotesKey ¶
func GetIndexingNodeRegistrationVotesKey(nodeAddr sdk.AccAddress) []byte
GetIndexingNodeRegistrationVotesKey get the key for the vote for Indexing node registration
func GetLastIndexingNodeStakeKey ¶
func GetLastIndexingNodeStakeKey(nodeAddr sdk.AccAddress) []byte
GetLastIndexingNodeStakeKey get the bonded indexing node index key for an address
func GetLastResourceNodeStakeKey ¶
func GetLastResourceNodeStakeKey(nodeAddr sdk.AccAddress) []byte
GetLastResourceNodeStakeKey get the bonded resource node index key for an address
func GetResourceNodeKey ¶
func GetResourceNodeKey(nodeAddr sdk.AccAddress) []byte
GetResourceNodeKey gets the key for the resourceNode with address VALUE: ResourceNode
func GetUBDNodeKey ¶ added in v0.4.0
func GetUBDNodeKey(nodeAddr sdk.AccAddress) []byte
GetURNKey gets the key for the unbonding Node with address
func GetUBDTimeKey ¶ added in v0.4.0
gets the prefix for all unbonding Node
func MustMarshalIndexingNode ¶
func MustMarshalIndexingNode(cdc *codec.Codec, indexingNode IndexingNode) []byte
MustMarshalIndexingNode returns the indexingNode bytes. Panics if fails
func MustMarshalResourceNode ¶
func MustMarshalResourceNode(cdc *codec.Codec, resourceNode ResourceNode) []byte
MustMarshalResourceNode returns the resourceNode bytes. Panics if fails
func MustMarshalUnbondingNode ¶ added in v0.4.0
func MustMarshalUnbondingNode(cdc *codec.Codec, uin UnbondingNode) []byte
return the unbonding Node
func RegisterCodec ¶
RegisterCodec registers concrete types on codec
func ValidateGenesis ¶
func ValidateGenesis(data GenesisState) error
ValidateGenesis validates the register genesis parameters
Types ¶
type AccountKeeper ¶
type AccountKeeper interface { IterateAccounts(ctx sdk.Context, process func(authexported.Account) (stop bool)) GetAccount(ctx sdk.Context, addr sdk.AccAddress) authexported.Account // only used for simulation }
AccountKeeper defines the expected account keeper (noalias)
type Bech32PubKeyType ¶
type Bech32PubKeyType string
Bech32PubKeyType defines a string type alias for a Bech32 public key type.
type Description ¶
type Description struct { Moniker string `json:"moniker" yaml:"moniker"` // name Identity string `json:"identity" yaml:"identity"` // optional identity signature (ex. UPort or Keybase) Website string `json:"website" yaml:"website"` // optional website link SecurityContact string `json:"security_contact" yaml:"security_contact"` // optional security contact info Details string `json:"details" yaml:"details"` // optional details }
Description - description fields for a resource/indexing node
func NewDescription ¶
func NewDescription(moniker, identity, website, securityContact, details string) Description
NewDescription returns a new Description with the provided values.
func (Description) EnsureLength ¶
func (d Description) EnsureLength() (Description, error)
EnsureLength ensures the length of a resource/indexing node's description.
func (Description) String ¶ added in v0.4.0
func (d Description) String() string
type GenesisIndexingNode ¶ added in v0.4.0
type GenesisIndexingNode struct { NetworkID string `json:"network_id" yaml:"network_id"` // network address of the indexing node PubKey string `json:"pubkey" yaml:"pubkey"` // the consensus public key of the indexing node; bech encoded in JSON Suspend bool `json:"suspend" yaml:"suspend"` // has the indexing node been suspended from bonded status? Status sdk.BondStatus `json:"status" yaml:"status"` // indexing node status (bonded/unbonding/unbonded) Tokens string `json:"tokens" yaml:"tokens"` // delegated tokens OwnerAddress string `json:"owner_address" yaml:"owner_address"` // owner address of the indexing node Description Description `json:"description" yaml:"description"` // description terms for the indexing node }
func (GenesisIndexingNode) ToIndexingNode ¶ added in v0.4.0
func (v GenesisIndexingNode) ToIndexingNode() IndexingNode
type GenesisState ¶
type GenesisState struct { Params Params `json:"params" yaml:"params"` LastResourceNodeStakes []LastResourceNodeStake `json:"last_resource_node_stakes" yaml:"last_resource_node_stakes"` ResourceNodes ResourceNodes `json:"resource_nodes" yaml:"resource_nodes"` LastIndexingNodeStakes []LastIndexingNodeStake `json:"last_indexing_node_stakes" yaml:"last_indexing_node_stakes"` IndexingNodes IndexingNodes `json:"indexing_nodes" yaml:"indexing_nodes"` InitialUozPrice sdk.Dec `json:"initial_uoz_price" yaml:"initial_uoz_price"` //initial price of uoz }
GenesisState - all register state that must be provided at genesis
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState - default GenesisState used by Cosmos Hub
func GetGenesisStateFromAppState ¶ added in v0.4.0
func GetGenesisStateFromAppState(cdc *codec.Codec, appState map[string]json.RawMessage) GenesisState
GetGenesisStateFromAppState returns x/auth GenesisState given raw application genesis state.
func NewGenesisState ¶
func NewGenesisState(params Params, lastResourceNodeStakes []LastResourceNodeStake, resourceNodes ResourceNodes, lastIndexingNodeStakes []LastIndexingNodeStake, indexingNodes IndexingNodes, initialUOzonePrice sdk.Dec, ) GenesisState
NewGenesisState creates a new GenesisState object
type IndexingNode ¶
type IndexingNode struct { NetworkID string `json:"network_id" yaml:"network_id"` // network id of the indexing node, sds://... PubKey crypto.PubKey `json:"pubkey" yaml:"pubkey"` // the consensus public key of the indexing node; bech encoded in JSON Suspend bool `json:"suspend" yaml:"suspend"` // has the indexing node been suspended from bonded status? Status sdk.BondStatus `json:"status" yaml:"status"` // indexing node status (bonded/unbonding/unbonded) Tokens sdk.Int `json:"tokens" yaml:"tokens"` // delegated tokens OwnerAddress sdk.AccAddress `json:"owner_address" yaml:"owner_address"` // owner address of the indexing node Description Description `json:"description" yaml:"description"` // description terms for the indexing node CreationTime time.Time `json:"creation_time" yaml:"creation_time"` }
func MustUnmarshalIndexingNode ¶
func MustUnmarshalIndexingNode(cdc *codec.Codec, value []byte) IndexingNode
MustUnmarshalIndexingNode unmarshal a indexing node from a store value. Panics if fails
func NewIndexingNode ¶
func NewIndexingNode(networkID string, pubKey crypto.PubKey, ownerAddr sdk.AccAddress, description Description, creationTime time.Time) IndexingNode
NewIndexingNode - initialize a new indexing node
func UnmarshalIndexingNode ¶
func UnmarshalIndexingNode(cdc *codec.Codec, value []byte) (indexingNode IndexingNode, err error)
UnmarshalIndexingNode unmarshal a indexing node from a store value
func (IndexingNode) AddToken ¶
func (v IndexingNode) AddToken(amount sdk.Int) IndexingNode
AddToken adds tokens to a indexing node
func (IndexingNode) Equal ¶ added in v0.4.0
func (indexingNode IndexingNode) Equal(indexingNode2 IndexingNode) bool
func (IndexingNode) GetCreationTime ¶ added in v0.4.0
func (v IndexingNode) GetCreationTime() time.Time
func (IndexingNode) GetMoniker ¶
func (v IndexingNode) GetMoniker() string
func (IndexingNode) GetNetworkAddr ¶
func (v IndexingNode) GetNetworkAddr() sdk.AccAddress
func (IndexingNode) GetNetworkID ¶
func (v IndexingNode) GetNetworkID() string
func (IndexingNode) GetOwnerAddr ¶
func (v IndexingNode) GetOwnerAddr() sdk.AccAddress
func (IndexingNode) GetPubKey ¶
func (v IndexingNode) GetPubKey() crypto.PubKey
func (IndexingNode) GetStatus ¶
func (v IndexingNode) GetStatus() sdk.BondStatus
func (IndexingNode) GetTokens ¶
func (v IndexingNode) GetTokens() sdk.Int
func (IndexingNode) IsBonded ¶ added in v0.6.0
func (v IndexingNode) IsBonded() bool
IsBonded checks if the node status equals Bonded
func (IndexingNode) IsSuspended ¶
func (v IndexingNode) IsSuspended() bool
func (IndexingNode) IsUnBonded ¶ added in v0.6.0
func (v IndexingNode) IsUnBonded() bool
IsUnBonded checks if the node status equals Unbonded
func (IndexingNode) IsUnBonding ¶ added in v0.6.0
func (v IndexingNode) IsUnBonding() bool
IsUnBonding checks if the node status equals Unbonding
func (IndexingNode) String ¶
func (v IndexingNode) String() string
String returns a human readable string representation of a indexing node.
func (IndexingNode) SubToken ¶ added in v0.4.0
func (v IndexingNode) SubToken(tokens sdk.Int) IndexingNode
SubToken removes tokens from a indexing node
func (IndexingNode) Validate ¶ added in v0.4.0
func (v IndexingNode) Validate() error
type IndexingNodeRegistrationVotePool ¶
type IndexingNodeRegistrationVotePool struct { NodeAddress sdk.AccAddress `json:"node_address" yaml:"node_address"` ApproveList []sdk.AccAddress `json:"approve_list" yaml:"approve_list"` RejectList []sdk.AccAddress `json:"reject_list" yaml:"reject_list"` ExpireTime time.Time `json:"expire_time" yaml:"expire_time"` }
func NewRegistrationVotePool ¶
func NewRegistrationVotePool(nodeAddress sdk.AccAddress, approveList []sdk.AccAddress, rejectList []sdk.AccAddress, expireTime time.Time) IndexingNodeRegistrationVotePool
type IndexingNodes ¶
type IndexingNodes []IndexingNode
IndexingNodes is a collection of indexing node
func (IndexingNodes) Sort ¶
func (v IndexingNodes) Sort()
Sort IndexingNodes sorts IndexingNode array in ascending owner address order
func (IndexingNodes) String ¶
func (v IndexingNodes) String() (out string)
func (IndexingNodes) Validate ¶ added in v0.4.0
func (v IndexingNodes) Validate() error
type LastIndexingNodeStake ¶
type LastIndexingNodeStake struct { Address sdk.AccAddress `json:"address" yaml:"address"` Stake sdk.Int `json:"stake" yaml:"stake"` }
LastIndexingNodeStake required for indexing node set update logic
type LastResourceNodeStake ¶
type LastResourceNodeStake struct { Address sdk.AccAddress `json:"address" yaml:"address"` Stake sdk.Int `json:"stake" yaml:"stake"` }
LastResourceNodeStake required for resource node set update logic
type MsgCreateIndexingNode ¶
type MsgCreateIndexingNode struct { NetworkID string `json:"network_id" yaml:"network_id"` PubKey crypto.PubKey `json:"pubkey" yaml:"pubkey"` Value sdk.Coin `json:"value" yaml:"value"` OwnerAddress sdk.AccAddress `json:"owner_address" yaml:"owner_address"` Description Description `json:"description" yaml:"description"` }
func NewMsgCreateIndexingNode ¶
func NewMsgCreateIndexingNode(networkID string, pubKey crypto.PubKey, value sdk.Coin, ownerAddr sdk.AccAddress, description Description, ) MsgCreateIndexingNode
NewMsgCreateIndexingNode NewMsg<Action> creates a new Msg<Action> instance
func (MsgCreateIndexingNode) GetSignBytes ¶
func (msg MsgCreateIndexingNode) GetSignBytes() []byte
func (MsgCreateIndexingNode) GetSigners ¶
func (msg MsgCreateIndexingNode) GetSigners() []sdk.AccAddress
func (MsgCreateIndexingNode) Route ¶
func (msg MsgCreateIndexingNode) Route() string
func (MsgCreateIndexingNode) Type ¶
func (msg MsgCreateIndexingNode) Type() string
func (MsgCreateIndexingNode) ValidateBasic ¶
func (msg MsgCreateIndexingNode) ValidateBasic() error
type MsgCreateResourceNode ¶
type MsgCreateResourceNode struct { NetworkID string `json:"network_id" yaml:"network_id"` PubKey crypto.PubKey `json:"pubkey" yaml:"pubkey"` Value sdk.Coin `json:"value" yaml:"value"` OwnerAddress sdk.AccAddress `json:"owner_address" yaml:"owner_address"` Description Description `json:"description" yaml:"description"` NodeType string `json:"node_type" yaml:"node_type"` }
func NewMsgCreateResourceNode ¶
func NewMsgCreateResourceNode(networkID string, pubKey crypto.PubKey, value sdk.Coin, ownerAddr sdk.AccAddress, description Description, nodeType string, ) MsgCreateResourceNode
NewMsgCreateResourceNode NewMsg<Action> creates a new Msg<Action> instance
func (MsgCreateResourceNode) GetSignBytes ¶
func (msg MsgCreateResourceNode) GetSignBytes() []byte
func (MsgCreateResourceNode) GetSigners ¶
func (msg MsgCreateResourceNode) GetSigners() []sdk.AccAddress
func (MsgCreateResourceNode) Route ¶
func (msg MsgCreateResourceNode) Route() string
func (MsgCreateResourceNode) Type ¶
func (msg MsgCreateResourceNode) Type() string
func (MsgCreateResourceNode) ValidateBasic ¶
func (msg MsgCreateResourceNode) ValidateBasic() error
ValidateBasic validity check for the CreateResourceNode
type MsgIndexingNodeRegistrationVote ¶
type MsgIndexingNodeRegistrationVote struct { CandidateNetworkAddress sdk.AccAddress `json:"candidate_network_address" yaml:"candidate_network_address"` // node address of indexing node CandidateOwnerAddress sdk.AccAddress `json:"candidate_owner_address" yaml:"candidate_owner_address"` // owner address of indexing node Opinion VoteOpinion `json:"opinion" yaml:"opinion"` VoterNetworkAddress sdk.AccAddress `json:"voter_network_address" yaml:"voter_network_address"` // address of voter (other existed indexing node) VoterOwnerAddress sdk.AccAddress `json:"voter_owner_address" yaml:"voter_owner_address"` // address of owner of the voter (other existed indexing node) }
func NewMsgIndexingNodeRegistrationVote ¶
func NewMsgIndexingNodeRegistrationVote(candidateNetworkAddress sdk.AccAddress, candidateOwnerAddress sdk.AccAddress, opinion VoteOpinion, voterNetworkAddress sdk.AccAddress, voterOwnerAddress sdk.AccAddress) MsgIndexingNodeRegistrationVote
func (MsgIndexingNodeRegistrationVote) GetSignBytes ¶
func (m MsgIndexingNodeRegistrationVote) GetSignBytes() []byte
func (MsgIndexingNodeRegistrationVote) GetSigners ¶
func (m MsgIndexingNodeRegistrationVote) GetSigners() []sdk.AccAddress
func (MsgIndexingNodeRegistrationVote) Route ¶
func (m MsgIndexingNodeRegistrationVote) Route() string
func (MsgIndexingNodeRegistrationVote) Type ¶
func (m MsgIndexingNodeRegistrationVote) Type() string
func (MsgIndexingNodeRegistrationVote) ValidateBasic ¶
func (m MsgIndexingNodeRegistrationVote) ValidateBasic() error
type MsgRemoveIndexingNode ¶
type MsgRemoveIndexingNode struct { IndexingNodeAddress sdk.AccAddress `json:"indexing_node_address" yaml:"indexing_node_address"` OwnerAddress sdk.AccAddress `json:"owner_address" yaml:"owner_address"` }
MsgRemoveIndexingNode - struct for removing indexing node
func NewMsgRemoveIndexingNode ¶
func NewMsgRemoveIndexingNode(indexingNodeAddr sdk.AccAddress, ownerAddr sdk.AccAddress) MsgRemoveIndexingNode
NewMsgRemoveIndexingNode creates a new MsgRemoveIndexingNode instance.
func (MsgRemoveIndexingNode) GetSignBytes ¶
func (msg MsgRemoveIndexingNode) GetSignBytes() []byte
GetSignBytes implements the sdk.Msg interface.
func (MsgRemoveIndexingNode) GetSigners ¶
func (msg MsgRemoveIndexingNode) GetSigners() []sdk.AccAddress
GetSigners implements the sdk.Msg interface.
func (MsgRemoveIndexingNode) Route ¶
func (msg MsgRemoveIndexingNode) Route() string
Route implements the sdk.Msg interface.
func (MsgRemoveIndexingNode) Type ¶
func (msg MsgRemoveIndexingNode) Type() string
Type implements the sdk.Msg interface.
func (MsgRemoveIndexingNode) ValidateBasic ¶
func (msg MsgRemoveIndexingNode) ValidateBasic() error
ValidateBasic implements the sdk.Msg interface.
type MsgRemoveResourceNode ¶
type MsgRemoveResourceNode struct { ResourceNodeAddress sdk.AccAddress `json:"resource_node_address" yaml:"resource_node_address"` OwnerAddress sdk.AccAddress `json:"owner_address" yaml:"owner_address"` }
MsgRemoveResourceNode - struct for removing resource node
func NewMsgRemoveResourceNode ¶
func NewMsgRemoveResourceNode(resourceNodeAddr sdk.AccAddress, ownerAddr sdk.AccAddress) MsgRemoveResourceNode
NewMsgRemoveResourceNode creates a new MsgRemoveResourceNode instance.
func (MsgRemoveResourceNode) GetSignBytes ¶
func (msg MsgRemoveResourceNode) GetSignBytes() []byte
GetSignBytes implements the sdk.Msg interface.
func (MsgRemoveResourceNode) GetSigners ¶
func (msg MsgRemoveResourceNode) GetSigners() []sdk.AccAddress
GetSigners implements the sdk.Msg interface.
func (MsgRemoveResourceNode) Route ¶
func (msg MsgRemoveResourceNode) Route() string
Route implements the sdk.Msg interface.
func (MsgRemoveResourceNode) Type ¶
func (msg MsgRemoveResourceNode) Type() string
Type implements the sdk.Msg interface.
func (MsgRemoveResourceNode) ValidateBasic ¶
func (msg MsgRemoveResourceNode) ValidateBasic() error
ValidateBasic implements the sdk.Msg interface.
type MsgUpdateIndexingNode ¶ added in v0.4.0
type MsgUpdateIndexingNode struct { NetworkID string `json:"network_id" yaml:"network_id"` Description Description `json:"description" yaml:"description"` NetworkAddress sdk.AccAddress `json:"network_address" yaml:"network_address"` OwnerAddress sdk.AccAddress `json:"owner_address" yaml:"owner_address"` }
MsgUpdateIndexingNode struct for updating indexing node
func NewMsgUpdateIndexingNode ¶ added in v0.4.0
func NewMsgUpdateIndexingNode( networkID string, description Description, networkAddress sdk.AccAddress, ownerAddress sdk.AccAddress, ) MsgUpdateIndexingNode
func (MsgUpdateIndexingNode) GetSignBytes ¶ added in v0.4.0
func (msg MsgUpdateIndexingNode) GetSignBytes() []byte
GetSignBytes implements the sdk.Msg interface.
func (MsgUpdateIndexingNode) GetSigners ¶ added in v0.4.0
func (msg MsgUpdateIndexingNode) GetSigners() []sdk.AccAddress
GetSigners implements the sdk.Msg interface.
func (MsgUpdateIndexingNode) Route ¶ added in v0.4.0
func (msg MsgUpdateIndexingNode) Route() string
Route implements the sdk.Msg interface.
func (MsgUpdateIndexingNode) Type ¶ added in v0.4.0
func (msg MsgUpdateIndexingNode) Type() string
Type implements the sdk.Msg interface.
func (MsgUpdateIndexingNode) ValidateBasic ¶ added in v0.4.0
func (msg MsgUpdateIndexingNode) ValidateBasic() error
ValidateBasic implements the sdk.Msg interface.
type MsgUpdateIndexingNodeStake ¶ added in v0.6.0
type MsgUpdateIndexingNodeStake struct { NetworkAddress sdk.AccAddress `json:"network_address" yaml:"network_address"` OwnerAddress sdk.AccAddress `json:"owner_address" yaml:"owner_address"` StakeDelta sdk.Coin `json:"stake_delta" yaml:"stake_delta"` IncrStake bool `json:"incr_stake" yaml:"incr_stake"` }
MsgUpdateIndexingNodeStake struct for updating indexing node's stake
func NewMsgUpdateIndexingNodeStake ¶ added in v0.6.0
func NewMsgUpdateIndexingNodeStake(networkAddress sdk.AccAddress, ownerAddress sdk.AccAddress, stakeDelta sdk.Coin, incrStake bool) MsgUpdateIndexingNodeStake
func (MsgUpdateIndexingNodeStake) GetSignBytes ¶ added in v0.6.0
func (msg MsgUpdateIndexingNodeStake) GetSignBytes() []byte
GetSignBytes implements the sdk.Msg interface.
func (MsgUpdateIndexingNodeStake) GetSigners ¶ added in v0.6.0
func (msg MsgUpdateIndexingNodeStake) GetSigners() []sdk.AccAddress
GetSigners implements the sdk.Msg interface.
func (MsgUpdateIndexingNodeStake) Route ¶ added in v0.6.0
func (msg MsgUpdateIndexingNodeStake) Route() string
Route implements the sdk.Msg interface.
func (MsgUpdateIndexingNodeStake) Type ¶ added in v0.6.0
func (msg MsgUpdateIndexingNodeStake) Type() string
Type implements the sdk.Msg interface.
func (MsgUpdateIndexingNodeStake) ValidateBasic ¶ added in v0.6.0
func (msg MsgUpdateIndexingNodeStake) ValidateBasic() error
ValidateBasic implements the sdk.Msg interface.
type MsgUpdateResourceNode ¶ added in v0.4.0
type MsgUpdateResourceNode struct { NetworkID string `json:"network_id" yaml:"network_id"` Description Description `json:"description" yaml:"description"` NodeType string `json:"node_type" yaml:"node_type"` NetworkAddress sdk.AccAddress `json:"network_address" yaml:"network_address"` OwnerAddress sdk.AccAddress `json:"owner_address" yaml:"owner_address"` }
MsgUpdateResourceNode struct for updating resource node
func NewMsgUpdateResourceNode ¶ added in v0.4.0
func NewMsgUpdateResourceNode(networkID string, description Description, nodeType string, networkAddress sdk.AccAddress, ownerAddress sdk.AccAddress) MsgUpdateResourceNode
func (MsgUpdateResourceNode) GetSignBytes ¶ added in v0.4.0
func (msg MsgUpdateResourceNode) GetSignBytes() []byte
GetSignBytes implements the sdk.Msg interface.
func (MsgUpdateResourceNode) GetSigners ¶ added in v0.4.0
func (msg MsgUpdateResourceNode) GetSigners() []sdk.AccAddress
GetSigners implements the sdk.Msg interface.
func (MsgUpdateResourceNode) Route ¶ added in v0.4.0
func (msg MsgUpdateResourceNode) Route() string
Route implements the sdk.Msg interface.
func (MsgUpdateResourceNode) Type ¶ added in v0.4.0
func (msg MsgUpdateResourceNode) Type() string
Type implements the sdk.Msg interface.
func (MsgUpdateResourceNode) ValidateBasic ¶ added in v0.4.0
func (msg MsgUpdateResourceNode) ValidateBasic() error
ValidateBasic implements the sdk.Msg interface.
type MsgUpdateResourceNodeStake ¶ added in v0.6.0
type MsgUpdateResourceNodeStake struct { NetworkAddress sdk.AccAddress `json:"network_address" yaml:"network_address"` OwnerAddress sdk.AccAddress `json:"owner_address" yaml:"owner_address"` StakeDelta sdk.Coin `json:"stake_delta" yaml:"stake_delta"` IncrStake bool `json:"incr_stake" yaml:"incr_stake"` }
MsgUpdateResourceNodeStake struct for only updating resource node's stake
func NewMsgUpdateResourceNodeStake ¶ added in v0.6.0
func NewMsgUpdateResourceNodeStake(networkAddress sdk.AccAddress, ownerAddress sdk.AccAddress, stakeDelta sdk.Coin, incrStake bool) MsgUpdateResourceNodeStake
func (MsgUpdateResourceNodeStake) GetSignBytes ¶ added in v0.6.0
func (msg MsgUpdateResourceNodeStake) GetSignBytes() []byte
GetSignBytes implements the sdk.Msg interface.
func (MsgUpdateResourceNodeStake) GetSigners ¶ added in v0.6.0
func (msg MsgUpdateResourceNodeStake) GetSigners() []sdk.AccAddress
GetSigners implements the sdk.Msg interface.
func (MsgUpdateResourceNodeStake) Route ¶ added in v0.6.0
func (msg MsgUpdateResourceNodeStake) Route() string
Route implements the sdk.Msg interface.
func (MsgUpdateResourceNodeStake) Type ¶ added in v0.6.0
func (msg MsgUpdateResourceNodeStake) Type() string
Type implements the sdk.Msg interface.
func (MsgUpdateResourceNodeStake) ValidateBasic ¶ added in v0.6.0
func (msg MsgUpdateResourceNodeStake) ValidateBasic() error
ValidateBasic implements the sdk.Msg interface.
type MultiRegisterHooks ¶ added in v0.4.0
type MultiRegisterHooks []RegisterHooks
combine multiple register hooks, all hook functions are run in array sequence
func NewMultiRegisterHooks ¶ added in v0.4.0
func NewMultiRegisterHooks(hooks ...RegisterHooks) MultiRegisterHooks
func (MultiRegisterHooks) AfterNodeBeginUnbonding ¶ added in v0.4.0
func (h MultiRegisterHooks) AfterNodeBeginUnbonding(ctx sdk.Context, networkAddr sdk.AccAddress, isIndexingNode bool)
func (MultiRegisterHooks) AfterNodeBonded ¶ added in v0.4.0
func (h MultiRegisterHooks) AfterNodeBonded(ctx sdk.Context, networkAddr sdk.AccAddress, isIndexingNode bool)
func (MultiRegisterHooks) AfterNodeCreated ¶ added in v0.4.0
func (h MultiRegisterHooks) AfterNodeCreated(ctx sdk.Context, networkAddr sdk.AccAddress, isIndexingNode bool)
nolint
func (MultiRegisterHooks) AfterNodeRemoved ¶ added in v0.4.0
func (h MultiRegisterHooks) AfterNodeRemoved(ctx sdk.Context, networkAddr sdk.AccAddress, isIndexingNode bool)
func (MultiRegisterHooks) BeforeNodeModified ¶ added in v0.4.0
func (h MultiRegisterHooks) BeforeNodeModified(ctx sdk.Context, networkAddr sdk.AccAddress, isIndexingNode bool)
type NodesStakingInfo ¶ added in v0.6.0
type NodesStakingInfo struct { TotalStakeOfResourceNodes sdk.Coin TotalStakeOfIndexingNodes sdk.Coin TotalBondedStake sdk.Coin TotalUnbondedStake sdk.Coin TotalUnbondingStake sdk.Coin }
NodesStakingInfo Params for query 'custom/register/staking'
func NewQueryNodesStakingInfo ¶ added in v0.6.0
func NewQueryNodesStakingInfo( totalStakeOfResourceNodes, totalStakeOfIndexingNodes, totalBondedStake, totalUnbondedStake, totalUnbondingStake sdk.Int, ) NodesStakingInfo
NewQueryNodesStakingInfo creates a new instance of NodesStakingInfo
type ParamSubspace ¶
type ParamSubspace interface { WithKeyTable(table params.KeyTable) params.Subspace Get(ctx sdk.Context, key []byte, ptr interface{}) GetParamSet(ctx sdk.Context, ps params.ParamSet) SetParamSet(ctx sdk.Context, ps params.ParamSet) }
ParamSubspace defines the expected Subspace interface
type Params ¶
type Params struct { BondDenom string `json:"bond_denom" yaml:"bond_denom"` // bondable coin denomination UnbondingThreasholdTime time.Duration `json:"unbonding_threashold_time" yaml:"unbonding_threashold_time"` // threashold for unbonding - by default 180 days UnbondingCompletionTime time.Duration `json:"unbonding_completion_time" yaml:"unbonding_completion_time"` // lead time to complete unbonding - by default 14 days MaxEntries uint16 `json:"max_entries" yaml:"max_entries"` // max entries for either unbonding delegation or redelegation (per pair/trio) }
Params - used for initializing default parameter for register at genesis
func DefaultParams ¶
func DefaultParams() Params
DefaultParams defines the parameters for this module
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() params.ParamSetPairs
ParamSetPairs - Implements params.ParamSet
type QueryNodeStakingParams ¶ added in v0.6.0
type QueryNodeStakingParams struct { AccAddr sdk.AccAddress QueryType int64 //0:All(Default) 1: indexingNode; 2: ResourceNode }
func NewQueryNodeStakingParams ¶ added in v0.6.0
func NewQueryNodeStakingParams(nodeAddr sdk.AccAddress, queryType int64) QueryNodeStakingParams
NewQueryNodeStakingParams creates a new instance of QueryNodesParams
type QueryNodesParams ¶ added in v0.6.0
type QueryNodesParams struct { Page int Limit int NetworkID string Moniker string OwnerAddr sdk.AccAddress }
QueryNodesParams Params for query 'custom/register/resource-nodes'
func NewQueryNodesParams ¶ added in v0.6.0
func NewQueryNodesParams(page, limit int, networkID, moniker string, ownerAddr sdk.AccAddress) QueryNodesParams
NewQueryNodesParams creates a new instance of QueryNodesParams
type RegisterHooks ¶ added in v0.4.0
type RegisterHooks interface { AfterNodeCreated(ctx sdk.Context, networkAddr sdk.AccAddress, isIndexingNode bool) // Must be called when a node is created BeforeNodeModified(ctx sdk.Context, networkAddr sdk.AccAddress, isIndexingNode bool) // Must be called when a node's state changes AfterNodeRemoved(ctx sdk.Context, networkAddr sdk.AccAddress, isIndexingNode bool) // Must be called when a node is deleted AfterNodeBonded(ctx sdk.Context, networkAddr sdk.AccAddress, isIndexingNode bool) // Must be called when a node is bonded AfterNodeBeginUnbonding(ctx sdk.Context, networkAddr sdk.AccAddress, isIndexingNode bool) // Must be called when a node begins unbonding }
RegisterHooks event hooks for registered node object (noalias)
type ResourceNode ¶
type ResourceNode struct { NetworkID string `json:"network_id" yaml:"network_id"` // network id of the resource node, sds://... PubKey crypto.PubKey `json:"pubkey" yaml:"pubkey"` // the public key of the resource node; bech encoded in JSON Suspend bool `json:"suspend" yaml:"suspend"` // has the resource node been suspended from bonded status? Status sdk.BondStatus `json:"status" yaml:"status"` // resource node bond status (bonded/unbonding/unbonded) Tokens sdk.Int `json:"tokens" yaml:"tokens"` // delegated tokens OwnerAddress sdk.AccAddress `json:"owner_address" yaml:"owner_address"` // owner address of the resource node Description Description `json:"description" yaml:"description"` // description terms for the resource node NodeType string `json:"node_type" yaml:"node_type"` CreationTime time.Time `json:"creation_time" yaml:"creation_time"` }
func MustUnmarshalResourceNode ¶
func MustUnmarshalResourceNode(cdc *codec.Codec, value []byte) ResourceNode
MustUnmarshalResourceNode unmarshal a resourceNode from a store value. Panics if fails
func NewResourceNode ¶
func NewResourceNode(networkID string, pubKey crypto.PubKey, ownerAddr sdk.AccAddress, description Description, nodeType string, creationTime time.Time) ResourceNode
NewResourceNode - initialize a new resource node
func UnmarshalResourceNode ¶
func UnmarshalResourceNode(cdc *codec.Codec, value []byte) (resourceNode ResourceNode, err error)
UnmarshalResourceNode unmarshal a resourceNode from a store value
func (ResourceNode) AddToken ¶
func (v ResourceNode) AddToken(amount sdk.Int) ResourceNode
AddToken adds tokens to a resource node
func (ResourceNode) Equal ¶ added in v0.4.0
func (resourceNode ResourceNode) Equal(resourceNode2 ResourceNode) bool
func (ResourceNode) GetCreationTime ¶ added in v0.4.0
func (v ResourceNode) GetCreationTime() time.Time
func (ResourceNode) GetMoniker ¶
func (v ResourceNode) GetMoniker() string
func (ResourceNode) GetNetworkAddr ¶
func (v ResourceNode) GetNetworkAddr() sdk.AccAddress
func (ResourceNode) GetNetworkID ¶
func (v ResourceNode) GetNetworkID() string
func (ResourceNode) GetNodeType ¶
func (v ResourceNode) GetNodeType() string
func (ResourceNode) GetOwnerAddr ¶
func (v ResourceNode) GetOwnerAddr() sdk.AccAddress
func (ResourceNode) GetPubKey ¶
func (v ResourceNode) GetPubKey() crypto.PubKey
func (ResourceNode) GetStatus ¶
func (v ResourceNode) GetStatus() sdk.BondStatus
func (ResourceNode) GetTokens ¶
func (v ResourceNode) GetTokens() sdk.Int
func (ResourceNode) IsBonded ¶ added in v0.6.0
func (v ResourceNode) IsBonded() bool
IsBonded checks if the node status equals Bonded
func (ResourceNode) IsSuspended ¶
func (v ResourceNode) IsSuspended() bool
func (ResourceNode) IsUnBonded ¶ added in v0.6.0
func (v ResourceNode) IsUnBonded() bool
IsUnBonded checks if the node status equals Unbonded
func (ResourceNode) IsUnBonding ¶ added in v0.6.0
func (v ResourceNode) IsUnBonding() bool
IsUnBonding checks if the node status equals Unbonding
func (ResourceNode) String ¶
func (v ResourceNode) String() string
String returns a human readable string representation of a resource node.
func (ResourceNode) SubToken ¶ added in v0.4.0
func (v ResourceNode) SubToken(tokens sdk.Int) ResourceNode
SubToken removes tokens from a resource node
func (ResourceNode) Validate ¶ added in v0.4.0
func (v ResourceNode) Validate() error
type ResourceNodes ¶
type ResourceNodes []ResourceNode
ResourceNodes is a collection of resource node
func (ResourceNodes) Less ¶
func (v ResourceNodes) Less(i, j int) bool
Less implements sort interface
func (ResourceNodes) Sort ¶
func (v ResourceNodes) Sort()
Sort ResourceNodes sorts ResourceNode array in ascending owner address order
func (ResourceNodes) String ¶
func (v ResourceNodes) String() (out string)
func (ResourceNodes) Validate ¶ added in v0.4.0
func (v ResourceNodes) Validate() error
type StakingInfo ¶ added in v0.6.0
type StakingInfo struct { NetworkID string `json:"network_id"` PubKey crypto.PubKey `json:"pub_key"` Suspend bool `json:"suspend"` Status sdk.BondStatus `json:"status"` Tokens sdk.Int `json:"tokens"` OwnerAddress sdk.AccAddress `json:"owner_address"` Description Description `json:"description"` NodeType string `json:"node_type"` CreationTime time.Time `json:"creation_time"` BondedStake sdk.Coin `json:"bonded_stake"` UnBondingStake sdk.Coin `json:"un_bonding_stake"` UnBondedStake sdk.Coin `json:"un_bonded_stake"` }
func NewStakingInfoByIndexingNodeAddr ¶ added in v0.6.0
func NewStakingInfoByIndexingNodeAddr( indexingNode IndexingNode, unBondingStake sdk.Int, unBondedStake sdk.Int, bondedStake sdk.Int, ) StakingInfo
NewStakingInfoByIndexingNodeAddr creates a new instance of StakingInfoByNodeAddr
func NewStakingInfoByResourceNodeAddr ¶ added in v0.6.0
func NewStakingInfoByResourceNodeAddr( resourceNode ResourceNode, unBondingStake sdk.Int, unBondedStake sdk.Int, bondedStake sdk.Int, ) StakingInfo
NewStakingInfoByResourceNodeAddr creates a new instance of StakingInfoByNodeAddr
type SupplyKeeper ¶
type SupplyKeeper interface { GetSupply(ctx sdk.Context) supplyexported.SupplyI GetModuleAddress(name string) sdk.AccAddress GetModuleAccount(ctx sdk.Context, moduleName string) supplyexported.ModuleAccountI // TODO remove with genesis 2-phases refactor https://github.com/cosmos/cosmos-sdk/issues/2862 SetModuleAccount(sdk.Context, supplyexported.ModuleAccountI) SendCoinsFromModuleToModule(ctx sdk.Context, senderPool, recipientPool string, amt sdk.Coins) error UndelegateCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error DelegateCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error BurnCoins(ctx sdk.Context, name string, amt sdk.Coins) error }
SupplyKeeper defines the expected supply Keeper (noalias)
type UnbondingNode ¶ added in v0.4.0
type UnbondingNode struct { NetworkAddr sdk.AccAddress `json:"network_addr" yaml:"network_addr"` IsIndexingNode bool `json:"is_indexing_node yaml:"is_indexing_node` Entries []UnbondingNodeEntry `json:"entries" yaml:"entries"` // unbonding node entries }
UnbondingNode stores all of a single delegator's unbonding bonds for a single unbonding node in an time-ordered list
func MustUnmarshalUnbondingNode ¶ added in v0.4.0
func MustUnmarshalUnbondingNode(cdc *codec.Codec, value []byte) UnbondingNode
unmarshal a unbonding Node from a store value
func NewUnbondingNode ¶ added in v0.4.0
func NewUnbondingNode(networkAddr sdk.AccAddress, isIndexingNode bool, creationHeight int64, minTime time.Time, balance sdk.Int) UnbondingNode
NewUnbondingNode - create a new unbonding Node object
func UnmarshalUnbondingNode ¶ added in v0.4.0
func UnmarshalUnbondingNode(cdc *codec.Codec, value []byte) (uin UnbondingNode, err error)
unmarshal a unbonding Node from a store value
func (UnbondingNode) Equal ¶ added in v0.4.0
func (un UnbondingNode) Equal(un2 UnbondingNode) bool
nolint inefficient but only used in testing
func (UnbondingNode) GetNetworkAddr ¶ added in v0.4.0
func (un UnbondingNode) GetNetworkAddr() sdk.AccAddress
func (*UnbondingNode) RemoveEntry ¶ added in v0.4.0
func (un *UnbondingNode) RemoveEntry(i int64)
RemoveEntry - remove entry at index i to the unbonding Node
func (UnbondingNode) String ¶ added in v0.4.0
func (un UnbondingNode) String() string
String returns a human readable string representation of an UnbondingNode.
type UnbondingNodeEntry ¶ added in v0.4.0
type UnbondingNodeEntry struct { CreationHeight int64 `json:"creation_height" yaml:"creation_height"` // height which the unbonding took place CompletionTime time.Time `json:"completion_time" yaml:"completion_time"` // time at which the unbonding delegation will complete InitialBalance sdk.Int `json:"initial_balance" yaml:"initial_balance"` // ustos initially scheduled to receive at completion Balance sdk.Int `json:"balance" yaml:"balance"` // ustos to receive at completion }
UnbondingNodeEntry - entry to an UnbondingNode
func NewUnbondingNodeEntry ¶ added in v0.4.0
func NewUnbondingNodeEntry(creationHeight int64, completionTime time.Time, balance sdk.Int) UnbondingNodeEntry
NewUnbondingNodeEntry - create a new unbonding Node object
type UnbondingNodes ¶ added in v0.4.0
type UnbondingNodes []UnbondingNode
UnbondingNodes is a collection of UnbondingNode
func (UnbondingNodes) String ¶ added in v0.4.0
func (uns UnbondingNodes) String() (out string)
type VoteOpinion ¶
type VoteOpinion bool
func VoteOpinionFromBool ¶
func VoteOpinionFromBool(b bool) VoteOpinion
func (VoteOpinion) Equal ¶
func (v VoteOpinion) Equal(v2 VoteOpinion) bool
Equal compares two VoteOpinion instances
func (VoteOpinion) String ¶
func (v VoteOpinion) String() string
String implements the Stringer interface for VoteOpinion.