Documentation ¶
Index ¶
- Constants
- Variables
- func GetActiveConsensusGroupList(db StorageDatabase, snapshotHash *types.Hash) []*types.ConsensusGroupInfo
- func GetAddrFromVoteKey(key []byte) types.Address
- func GetBeneficialFromPledgeKey(key []byte) types.Address
- func GetCandidateList(db StorageDatabase, gid types.Gid, snapshotHash *types.Hash) []*types.Registration
- func GetConsensusGroup(db StorageDatabase, gid types.Gid) *types.ConsensusGroupInfo
- func GetConsensusGroupKey(gid types.Gid) []byte
- func GetGidFromConsensusGroupKey(key []byte) types.Gid
- func GetHisNameKey(addr types.Address, gid types.Gid) []byte
- func GetMintageKey(tokenId types.TokenTypeId) []byte
- func GetPledgeBeneficialAmount(db StorageDatabase, beneficial types.Address) *big.Int
- func GetPledgeBeneficialKey(beneficial types.Address) []byte
- func GetPledgeKey(addr types.Address, pledgeBeneficialKey []byte) []byte
- func GetRegisterKey(name string, gid types.Gid) []byte
- func GetRegistration(db StorageDatabase, gid types.Gid, name string) *types.Registration
- func GetRegistrationList(db StorageDatabase, gid types.Gid, pledgeAddr types.Address) []*types.Registration
- func GetTokenById(db StorageDatabase, tokenId types.TokenTypeId) *types.TokenInfo
- func GetTokenIdFromMintageKey(key []byte) types.TokenTypeId
- func GetTokenMap(db StorageDatabase) map[types.TokenTypeId]*types.TokenInfo
- func GetVote(db StorageDatabase, gid types.Gid, addr types.Address) *types.VoteInfo
- func GetVoteKey(addr types.Address, gid types.Gid) []byte
- func GetVoteList(db StorageDatabase, gid types.Gid, snapshotHash *types.Hash) []*types.VoteInfo
- func IsActiveRegistration(db StorageDatabase, name string, gid types.Gid) 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 PackConsensusGroupConditionParam(conditionIdPrefix ConditionCode, conditionId uint8, params ...interface{}) ([]byte, error)
- func PackMethodParam(contractsAddr types.Address, methodName string, params ...interface{}) ([]byte, error)
- type ConditionCode
- type ParamCancelPledge
- type ParamCancelRegister
- type ParamMintage
- type ParamRegister
- type ParamReward
- type ParamVote
- type PledgeInfo
- type StorageDatabase
- type VariableConditionRegisterOfPledge
- type VariableConditionVoteOfKeepToken
- type VariablePledgeBeneficial
Constants ¶
View Source
const ( MethodNameCreateConsensusGroup = "CreateConsensusGroup" MethodNameCancelConsensusGroup = "CancelConsensusGroup" MethodNameReCreateConsensusGroup = "ReCreateConsensusGroup" VariableNameConsensusGroupInfo = "consensusGroupInfo" VariableNameConditionRegisterOfPledge = "registerOfPledge" VariableNameConditionVoteOfKeepToken = "voteOfKeepToken" )
View Source
const ( MethodNameMintage = "Mintage" MethodNameMintageCancelPledge = "CancelPledge" VariableNameMintage = "mintage" )
View Source
const ( MethodNamePledge = "Pledge" MethodNameCancelPledge = "CancelPledge" VariableNamePledgeInfo = "pledgeInfo" VariableNamePledgeBeneficial = "pledgeBeneficial" )
View Source
const ( MethodNameRegister = "Register" MethodNameCancelRegister = "CancelRegister" MethodNameReward = "Reward" MethodNameUpdateRegistration = "UpdateRegistration" VariableNameRegistration = "registration" VariableNameHisName = "hisName" )
View Source
const ( MethodNameVote = "Vote" MethodNameCancelVote = "CancelVote" VariableNameVoteStatus = "voteStatus" )
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))
)
View Source
var (
ABIRegister, _ = abi.JSONToABIContract(strings.NewReader(jsonRegister))
)
View Source
var (
ABIVote, _ = abi.JSONToABIContract(strings.NewReader(jsonVote))
)
Functions ¶
func GetActiveConsensusGroupList ¶
func GetActiveConsensusGroupList(db StorageDatabase, snapshotHash *types.Hash) []*types.ConsensusGroupInfo
func GetAddrFromVoteKey ¶
func GetCandidateList ¶
func GetCandidateList(db StorageDatabase, gid types.Gid, snapshotHash *types.Hash) []*types.Registration
func GetConsensusGroup ¶
func GetConsensusGroup(db StorageDatabase, gid types.Gid) *types.ConsensusGroupInfo
func GetConsensusGroupKey ¶
func GetPledgeBeneficialAmount ¶
func GetPledgeBeneficialAmount(db StorageDatabase, beneficial types.Address) *big.Int
func GetPledgeBeneficialKey ¶
func GetRegistration ¶
func GetRegistration(db StorageDatabase, gid types.Gid, name string) *types.Registration
func GetRegistrationList ¶
func GetRegistrationList(db StorageDatabase, gid types.Gid, pledgeAddr types.Address) []*types.Registration
func GetTokenById ¶
func GetTokenById(db StorageDatabase, tokenId types.TokenTypeId) *types.TokenInfo
func GetTokenIdFromMintageKey ¶
func GetTokenIdFromMintageKey(key []byte) types.TokenTypeId
func GetTokenMap ¶
func GetTokenMap(db StorageDatabase) map[types.TokenTypeId]*types.TokenInfo
func GetVoteList ¶
func IsActiveRegistration ¶
func IsActiveRegistration(db StorageDatabase, name string, gid types.Gid) bool
func IsPledgeKey ¶
func IsRegisterKey ¶
func NewTokenId ¶
func PackConsensusGroupConditionParam ¶
func PackConsensusGroupConditionParam(conditionIdPrefix ConditionCode, conditionId uint8, params ...interface{}) ([]byte, error)
pack consensus group condition params by condition id
Types ¶
type ConditionCode ¶
type ConditionCode uint8
const ( RegisterConditionPrefix ConditionCode = 10 VoteConditionPrefix ConditionCode = 20 RegisterConditionOfPledge ConditionCode = 11 VoteConditionOfDefault ConditionCode = 21 VoteConditionOfBalance ConditionCode = 22 )
type ParamCancelRegister ¶
type ParamMintage ¶
type ParamReward ¶
type PledgeInfo ¶
func GetPledgeInfoList ¶
func GetPledgeInfoList(db StorageDatabase, addr types.Address) ([]*PledgeInfo, *big.Int)
type StorageDatabase ¶
type VariableConditionRegisterOfPledge ¶
type VariableConditionRegisterOfPledge struct { PledgeAmount *big.Int PledgeToken types.TokenTypeId PledgeHeight uint64 }
type VariableConditionVoteOfKeepToken ¶
type VariableConditionVoteOfKeepToken struct { KeepAmount *big.Int KeepToken types.TokenTypeId }
Click to show internal directories.
Click to hide internal directories.