Documentation ¶
Index ¶
- Constants
- Variables
- func AppendTokenId(oldIdList []byte, tokenId types.TokenTypeId) []byte
- func DeleteTokenId(oldIdList []byte, tokenId types.TokenTypeId) []byte
- func GetActiveConsensusGroupList(db StorageDatabase) ([]*types.ConsensusGroupInfo, error)
- func GetAddrFromVoteKey(key []byte) types.Address
- func GetAllRegistrationList(db StorageDatabase, gid types.Gid) ([]*types.Registration, error)
- func GetCandidateList(db StorageDatabase, gid types.Gid) ([]*types.Registration, error)
- func GetConsensusGroup(db StorageDatabase, gid types.Gid) (*types.ConsensusGroupInfo, error)
- func GetConsensusGroupKey(gid types.Gid) []byte
- func GetGidFromConsensusGroupKey(key []byte) types.Gid
- func GetHisNameKey(addr types.Address, gid types.Gid) []byte
- func GetIndexFromPledgeKey(key []byte) uint64
- func GetMintageKey(tokenId types.TokenTypeId) []byte
- func GetNextIndexKey(tokenSymbol string) []byte
- func GetOwnerTokenIdListKey(owner types.Address) []byte
- func GetPledgeAddrFromPledgeKey(key []byte) types.Address
- func GetPledgeBeneficialAmount(db StorageDatabase, beneficialAddr types.Address) (*big.Int, error)
- func GetPledgeBeneficialKey(beneficial types.Address) []byte
- func GetPledgeKey(addr types.Address, index uint64) []byte
- func GetPledgeKeyPrefix(addr types.Address) []byte
- func GetRegisterKey(name string, gid types.Gid) []byte
- func GetRegistration(db StorageDatabase, gid types.Gid, name string) (*types.Registration, error)
- func GetRegistrationList(db StorageDatabase, gid types.Gid, pledgeAddr types.Address) ([]*types.Registration, error)
- func GetTokenById(db StorageDatabase, tokenId types.TokenTypeId) (*types.TokenInfo, error)
- func GetTokenIdFromMintageKey(key []byte) types.TokenTypeId
- func GetTokenMap(db StorageDatabase) (map[types.TokenTypeId]*types.TokenInfo, error)
- func GetTokenMapByOwner(db StorageDatabase, owner types.Address) (tokenInfoMap map[types.TokenTypeId]*types.TokenInfo, err error)
- func GetVote(db StorageDatabase, gid types.Gid, addr types.Address) (*types.VoteInfo, error)
- func GetVoteKey(addr types.Address, gid types.Gid) []byte
- func GetVoteKeyPerfixByGid(gid types.Gid) []byte
- func GetVoteList(db StorageDatabase, gid types.Gid) ([]*types.VoteInfo, error)
- func IsActiveRegistration(db StorageDatabase, name string, gid types.Gid) (bool, error)
- func IsMintageKey(key []byte) bool
- func IsPledgeKey(key []byte) bool
- func IsRegisterKey(key []byte) bool
- func NewGid(accountAddress types.Address, accountBlockHeight uint64, ...) types.Gid
- func NewTokenId(accountAddress types.Address, accountBlockHeight uint64, ...) types.TokenTypeId
- func ParseTokenInfo(data []byte) (*types.TokenInfo, error)
- type ConditionCode
- type ParamAgentCancelPledge
- type ParamAgentPledge
- type ParamCancelPledge
- type ParamCancelRegister
- type ParamIssue
- type ParamMintage
- type ParamRegister
- type ParamReward
- type ParamTransferOwner
- type ParamVote
- type PledgeInfo
- type StorageDatabase
- type VariableConditionRegisterOfPledge
- type VariableConditionVoteOfKeepToken
- type VariablePledgeBeneficial
Constants ¶
View Source
const ( // Method names and variable names of consensus group MethodNameCreateConsensusGroup = "CreateConsensusGroup" MethodNameCancelConsensusGroup = "CancelConsensusGroup" MethodNameReCreateConsensusGroup = "ReCreateConsensusGroup" VariableNameConsensusGroupInfo = "consensusGroupInfo" VariableNameConditionRegisterOfPledge = "registerOfPledge" VariableNameConditionVoteOfKeepToken = "voteOfKeepToken" // Method names and variable names of register MethodNameRegister = "Register" MethodNameCancelRegister = "CancelRegister" MethodNameReward = "Reward" MethodNameUpdateRegistration = "UpdateRegistration" VariableNameRegistration = "registration" VariableNameHisName = "hisName" // Method names and variable names of vote MethodNameVote = "Vote" MethodNameCancelVote = "CancelVote" VariableNameVoteStatus = "voteStatus" )
View Source
const ( MethodNameCancelMintPledge = "CancelMintPledge" MethodNameMint = "Mint" MethodNameIssue = "Issue" MethodNameBurn = "Burn" MethodNameTransferOwner = "TransferOwner" MethodNameChangeTokenType = "ChangeTokenType" MethodNameGetTokenInfo = "GetTokenInfo" VariableNameTokenInfo = "tokenInfo" VariableNameTokenNameIndex = "tokenNameIndex" EventNameMint = "mint" EventNameIssue = "issue" EventNameBurn = "burn" EventNameTransferOwner = "transferOwner" EventNameChangeTokenType = "changeTokenType" )
View Source
const ( MethodNamePledge = "Pledge" MethodNameCancelPledge = "CancelPledge" MethodNameAgentPledge = "AgentPledge" MethodNameAgentCancelPledge = "AgentCancelPledge" VariableNamePledgeInfo = "pledgeInfo" VariableNamePledgeBeneficial = "pledgeBeneficial" )
Variables ¶
View Source
var (
ABIConsensusGroup, _ = abi.JSONToABIContract(strings.NewReader(jsonConsensusGroup))
)
View Source
var (
ABIMintage, _ = abi.JSONToABIContract(strings.NewReader(jsonMintage))
)
View Source
var (
ABIPledge, _ = abi.JSONToABIContract(strings.NewReader(jsonPledge))
)
Functions ¶
func AppendTokenId ¶ added in v1.3.0
func AppendTokenId(oldIdList []byte, tokenId types.TokenTypeId) []byte
func DeleteTokenId ¶ added in v1.3.0
func DeleteTokenId(oldIdList []byte, tokenId types.TokenTypeId) []byte
func GetActiveConsensusGroupList ¶
func GetActiveConsensusGroupList(db StorageDatabase) ([]*types.ConsensusGroupInfo, error)
func GetAllRegistrationList ¶
func GetAllRegistrationList(db StorageDatabase, gid types.Gid) ([]*types.Registration, error)
func GetCandidateList ¶
func GetCandidateList(db StorageDatabase, gid types.Gid) ([]*types.Registration, error)
func GetConsensusGroup ¶
func GetConsensusGroup(db StorageDatabase, gid types.Gid) (*types.ConsensusGroupInfo, error)
func GetConsensusGroupKey ¶
Consensus group variable keys
func GetMintageKey ¶
func GetMintageKey(tokenId types.TokenTypeId) []byte
func GetOwnerTokenIdListKey ¶ added in v1.3.0
func GetPledgeAddrFromPledgeKey ¶ added in v1.3.2
func GetPledgeBeneficialAmount ¶
func GetRegistration ¶
func GetRegistration(db StorageDatabase, gid types.Gid, name string) (*types.Registration, error)
func GetRegistrationList ¶
func GetRegistrationList(db StorageDatabase, gid types.Gid, pledgeAddr types.Address) ([]*types.Registration, error)
func GetTokenById ¶
func GetTokenById(db StorageDatabase, tokenId types.TokenTypeId) (*types.TokenInfo, error)
func GetTokenIdFromMintageKey ¶
func GetTokenIdFromMintageKey(key []byte) types.TokenTypeId
func GetTokenMap ¶
func GetTokenMap(db StorageDatabase) (map[types.TokenTypeId]*types.TokenInfo, error)
func GetTokenMapByOwner ¶ added in v1.3.0
func GetTokenMapByOwner(db StorageDatabase, owner types.Address) (tokenInfoMap map[types.TokenTypeId]*types.TokenInfo, err error)
func GetVote ¶
Vote readers
func IsActiveRegistration ¶
Register readers
func NewGid ¶
func NewGid(accountAddress types.Address, accountBlockHeight uint64, prevBlockHash types.Hash, snapshotHash types.Hash) types.Gid
Consensus group readers
func NewTokenId ¶
Types ¶
type ConditionCode ¶
type ConditionCode uint8
const ( RegisterConditionPrefix ConditionCode = 10 VoteConditionPrefix ConditionCode = 20 RegisterConditionOfPledge ConditionCode = 11 VoteConditionOfDefault ConditionCode = 21 )
type ParamAgentCancelPledge ¶
type ParamAgentPledge ¶
type ParamIssue ¶ added in v1.3.0
type ParamMintage ¶
type ParamRegister ¶
Structs of register
type ParamReward ¶
type ParamTransferOwner ¶ added in v1.3.0
type ParamTransferOwner struct { TokenId types.TokenTypeId NewOwner types.Address }
type PledgeInfo ¶
type PledgeInfo struct { Amount *big.Int WithdrawHeight uint64 BeneficialAddr types.Address Agent bool AgentAddress types.Address Bid uint8 }
func GetPledgeInfoList ¶
func GetPledgeInfoList(db StorageDatabase, pledgeAddr types.Address) ([]*PledgeInfo, *big.Int, error)
type StorageDatabase ¶
type StorageDatabase interface { GetValue(key []byte) ([]byte, error) NewStorageIterator(prefix []byte) (interfaces.StorageIterator, error) Address() *types.Address }
type VariableConditionRegisterOfPledge ¶
type VariableConditionRegisterOfPledge struct { PledgeAmount *big.Int PledgeToken types.TokenTypeId PledgeHeight uint64 }
Structs of consensus group
func GetRegisterOfPledgeInfo ¶
func GetRegisterOfPledgeInfo(data []byte) (*VariableConditionRegisterOfPledge, error)
type VariableConditionVoteOfKeepToken ¶
type VariableConditionVoteOfKeepToken struct { KeepAmount *big.Int KeepToken types.TokenTypeId }
Click to show internal directories.
Click to hide internal directories.