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 MustMarshalIndexingNode(cdc *codec.Codec, indexingNode IndexingNode) []byte
- func MustMarshalResourceNode(cdc *codec.Codec, resourceNode ResourceNode) []byte
- func ParamKeyTable() params.KeyTable
- func RegisterCodec(cdc *codec.Codec)
- func ValidateGenesis(data GenesisState) error
- type AccountKeeper
- type Bech32PubKeyType
- type Description
- type GenesisState
- type IndexingNode
- func (v IndexingNode) AddToken(amount sdk.Int) IndexingNode
- 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) IsSuspended() bool
- func (v IndexingNode) RemoveToken(tokens sdk.Int) IndexingNode
- func (v IndexingNode) String() string
- 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 NodeType
- type ParamSubspace
- type Params
- type ResourceNode
- func (v ResourceNode) AddToken(amount sdk.Int) ResourceNode
- 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) IsSuspended() bool
- func (v ResourceNode) RemoveToken(tokens sdk.Int) ResourceNode
- func (v ResourceNode) String() string
- type ResourceNodes
- type SupplyKeeper
- type VoteOpinion
Constants ¶
const ( EventTypeCreateResourceNode = "create_resource_node" EventTypeRemoveResourceNode = "remove_resource_node" EventTypeCreateIndexingNode = "create_indexing_node" EventTypeRemoveIndexingNode = "remove_indexing_node" EventTypeIndexingNodeRegistrationVote = "indexing_node_reg_vote" AttributeKeyResourceNode = "resource_node" AttributeKeyIndexingNode = "indexing_node" AttributeKeyNodeAddress = "node_address" 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" )
Default parameter namespace
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") ErrEmptyNodeAddr = sdkerrors.Register(ModuleName, 17, "missing node address") ErrEmptyApproverAddr = sdkerrors.Register(ModuleName, 18, "missing approver address") ErrSameAddr = sdkerrors.Register(ModuleName, 19, "owner address should not same as the approver address") ErrInvalidOwnerAddr = sdkerrors.Register(ModuleName, 20, "invalid owner address") ErrInvalidApproverAddr = sdkerrors.Register(ModuleName, 21, "invalid approver address") ErrInvalidApproverStatus = sdkerrors.Register(ModuleName, 22, "invalid approver status") ErrNoRegistrationVotePoolFound = sdkerrors.Register(ModuleName, 23, "registration pool does not exist") ErrDuplicateVoting = sdkerrors.Register(ModuleName, 24, "duplicate voting") ErrVoteExpired = sdkerrors.Register(ModuleName, 25, "vote expired") )
var ( UpperBoundOfTotalOzoneKey = []byte{0x01} LastResourceNodeStakeKey = []byte{0x11} // prefix for each key to a resource node index, for bonded resource nodes LastResourceNodeTotalStakeKey = []byte{0x12} // prefix for the total bonded tokens of resource nodes LastIndexingNodeStakeKey = []byte{0x13} // prefix for each key to a indexing node index, for bonded indexing nodes LastIndexingNodeTotalStakeKey = []byte{0x14} // prefix for the total bonded tokens of indexing nodes InitialGenesisStakeTotalKey = []byte{0x15} // key of initial genesis deposit by all resource nodes and meta nodes 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 )
var (
KeyBondDenom = []byte("BondDenom")
)
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 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 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.
type GenesisState ¶
type GenesisState struct { Params Params `json:"params" yaml:"params"` LastResourceNodeTotalStake sdk.Int `json:"last_resource_node_total_stake" yaml:"last_resource_node_total_stake"` LastResourceNodeStakes []LastResourceNodeStake `json:"last_resource_node_stakes" yaml:"last_resource_node_stakes"` ResourceNodes ResourceNodes `json:"resource_nodes" yaml:"resource_nodes"` LastIndexingNodeTotalStake sdk.Int `json:"last_indexing_node_total_stake" yaml:"last_indexing_node_total_stake"` LastIndexingNodeStakes []LastIndexingNodeStake `json:"last_indexing_node_stakes" yaml:"last_indexing_node_stakes"` IndexingNodes IndexingNodes `json:"indexing_nodes" yaml:"indexing_nodes"` }
GenesisState - all register state that must be provided at genesis
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState - default GenesisState used by Cosmos Hub
func NewGenesisState ¶
func NewGenesisState(params Params, lastResourceNodeTotalStake sdk.Int, lastResourceNodeStakes []LastResourceNodeStake, resourceNodes []ResourceNode, lastIndexingNodeTotalStake sdk.Int, lastIndexingNodeStakes []LastIndexingNodeStake, indexingNodes []IndexingNode, ) GenesisState
NewGenesisState creates a new GenesisState object
type IndexingNode ¶
type IndexingNode struct { NetworkID string `json:"network_id" yaml:"network_id"` // network address of the indexing node 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 }
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) 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) 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) IsSuspended ¶
func (v IndexingNode) IsSuspended() bool
func (IndexingNode) RemoveToken ¶
func (v IndexingNode) RemoveToken(tokens sdk.Int) IndexingNode
RemoveToken removes tokens from a indexing node
func (IndexingNode) String ¶
func (v IndexingNode) String() string
String returns a human readable string representation of a indexing node.
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) ToSDKIndexingNodes ¶
func (v IndexingNodes) ToSDKIndexingNodes() (indexingNodes []exported.IndexingNodeI)
ToSDKIndexingNodes - convenience function convert []IndexingNodes to []sdk.IndexingNodes
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"` //NetworkAddress sdk.AccAddress `json:"network_address" yaml:"network_address"` 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 { NodeAddress sdk.AccAddress `json:"node_address" yaml:"node_address"` // node address of indexing node OwnerAddress sdk.AccAddress `json:"owner_address" yaml:"owner_address"` // owner address of indexing node Opinion VoteOpinion `json:"opinion" yaml:"opinion"` VoterAddress sdk.AccAddress `json:"voter_address" yaml:"voter_address"` // address of voter (other existed indexing node) }
func NewMsgIndexingNodeRegistrationVote ¶
func NewMsgIndexingNodeRegistrationVote(nodeAddress sdk.AccAddress, ownerAddress sdk.AccAddress, opinion VoteOpinion, approverAddress 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 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
}
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 ResourceNode ¶
type ResourceNode struct { NetworkID string `json:"network_id" yaml:"network_id"` // network id of the resource node 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"` }
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) 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) 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) IsSuspended ¶
func (v ResourceNode) IsSuspended() bool
func (ResourceNode) RemoveToken ¶
func (v ResourceNode) RemoveToken(tokens sdk.Int) ResourceNode
RemoveToken removes tokens from a resource node
func (ResourceNode) String ¶
func (v ResourceNode) String() string
String returns a human readable string representation of a resource node.
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) ToSDKResourceNodes ¶
func (v ResourceNodes) ToSDKResourceNodes() (resourceNodes []exported.ResourceNodeI)
ToSDKResourceNodes - convenience function convert []ResourceNodes to []sdk.ResourceNodes
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 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.