Documentation ¶
Index ¶
- Constants
- Variables
- func BigToCompact(n *big.Int) uint32
- func CalcDifficultyRatio(bits uint32, powLimitBits uint32) float64
- func CalcDifficultyRatioByBigInt(diffInt *big.Int, powLimitInt *big.Int) float64
- func CalcWorkBitsToBigInt(bits uint32) *big.Int
- func CalcWorkIntToBigInt(diffNum *big.Int) *big.Int
- func CompactToBig(compact uint32) *big.Int
- func HashToBig(hash *Hash) *big.Int
- func IsValidHexAddress(hexStr string) bool
- func KeypairFromPrivateKey(privateKey string) (ed25519.PublicKey, ed25519.PrivateKey)
- func KeypairFromSeed(seed string, index uint32) (ed25519.PublicKey, ed25519.PrivateKey, error)
- type Account
- func (a *Account) Address() Address
- func (z *Account) DecodeMsg(dc *msgp.Reader) (err error)
- func (z Account) EncodeMsg(en *msgp.Writer) (err error)
- func (z Account) MarshalMsg(b []byte) (o []byte, err error)
- func (z Account) Msgsize() (s int)
- func (a *Account) PrivateKey() ed25519.PrivateKey
- func (a *Account) Sign(hash Hash) Signature
- func (a *Account) SignData(data []byte) Signature
- func (a *Account) String() string
- func (z *Account) UnmarshalMsg(bts []byte) (o []byte, err error)
- type AccountMeta
- func (am *AccountMeta) Clone() *AccountMeta
- func (z *AccountMeta) DecodeMsg(dc *msgp.Reader) (err error)
- func (am *AccountMeta) Deserialize(text []byte) error
- func (z *AccountMeta) EncodeMsg(en *msgp.Writer) (err error)
- func (a *AccountMeta) GetBalance() Balance
- func (a *AccountMeta) GetNetwork() Balance
- func (a *AccountMeta) GetOracle() Balance
- func (a *AccountMeta) GetStorage() Balance
- func (a *AccountMeta) GetVote() Balance
- func (z *AccountMeta) MarshalMsg(b []byte) (o []byte, err error)
- func (z *AccountMeta) Msgsize() (s int)
- func (am *AccountMeta) Serialize() ([]byte, error)
- func (am *AccountMeta) String() string
- func (am *AccountMeta) Token(tt Hash) *TokenMeta
- func (a *AccountMeta) TotalBalance() Balance
- func (z *AccountMeta) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (a *AccountMeta) VoteWeight() Balance
- type Address
- func (addr Address) Bytes() []byte
- func (addr Address) Checksum() []byte
- func (z *Address) DecodeMsg(dc *msgp.Reader) (err error)
- func (addr *Address) Deserialize(text []byte) error
- func (z *Address) EncodeMsg(en *msgp.Writer) (err error)
- func (addr *Address) ExtensionType() int8
- func (addr Address) IsZero() bool
- func (addr *Address) Len() int
- func (addr Address) MarshalBinaryTo(text []byte) error
- func (z *Address) MarshalMsg(b []byte) (o []byte, err error)
- func (addr Address) MarshalText() (text []byte, err error)
- func (z *Address) Msgsize() (s int)
- func (addr Address) Serialize() ([]byte, error)
- func (addr *Address) SetBytes(b []byte) error
- func (addr Address) String() string
- func (addr *Address) ToHash() Hash
- func (addr *Address) UnmarshalBinary(text []byte) error
- func (z *Address) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (addr *Address) UnmarshalText(text []byte) error
- func (addr Address) Verify(data []byte, signature []byte) bool
- type AddressToken
- type Balance
- func (b Balance) Add(n Balance) Balance
- func (b Balance) Bytes() []byte
- func (b Balance) Compare(n Balance) BalanceComp
- func (b Balance) Copy() Balance
- func (b Balance) Div(n int64) (Balance, error)
- func (b Balance) Equal(b2 Balance) bool
- func (b *Balance) ExtensionType() int8
- func (b Balance) IsZero() bool
- func (b *Balance) Len() int
- func (b *Balance) MarshalBinaryTo(text []byte) error
- func (b Balance) MarshalJSON() ([]byte, error)
- func (b Balance) MarshalText() ([]byte, error)
- func (b Balance) Mul(n int64) Balance
- func (b Balance) String() string
- func (b Balance) Sub(n Balance) Balance
- func (b *Balance) UnmarshalBinary(text []byte) error
- func (b *Balance) UnmarshalJSON(text []byte) error
- func (b *Balance) UnmarshalText(text []byte) error
- type BalanceComp
- type Benefit
- func (b *Benefit) Clone() *Benefit
- func (z *Benefit) DecodeMsg(dc *msgp.Reader) (err error)
- func (b *Benefit) Deserialize(text []byte) error
- func (z *Benefit) EncodeMsg(en *msgp.Writer) (err error)
- func (z *Benefit) MarshalMsg(b []byte) (o []byte, err error)
- func (z *Benefit) Msgsize() (s int)
- func (b *Benefit) Serialize() ([]byte, error)
- func (b *Benefit) String() string
- func (z *Benefit) UnmarshalMsg(bts []byte) (o []byte, err error)
- type BigNum
- func (bn *BigNum) Add(x *BigNum, y *BigNum) *BigNum
- func (bn *BigNum) AddBigInt(x *big.Int, y *big.Int) *BigNum
- func (bn *BigNum) Cmp(y *BigNum) int
- func (bn *BigNum) CmpBigInt(y *big.Int) int
- func (bn *BigNum) Copy() *BigNum
- func (bn *BigNum) Div(x *BigNum, y *BigNum) *BigNum
- func (bn *BigNum) DivBigInt(x *big.Int, y *big.Int) *BigNum
- func (bn *BigNum) ExtensionType() int8
- func (bn *BigNum) Len() int
- func (bn *BigNum) MarshalBinaryTo(text []byte) error
- func (bn *BigNum) Mul(x *BigNum, y *BigNum) *BigNum
- func (bn *BigNum) MulBigInt(x *big.Int, y *big.Int) *BigNum
- func (bn *BigNum) Sub(x *BigNum, y *BigNum) *BigNum
- func (bn *BigNum) SubBigInt(x *big.Int, y *big.Int) *BigNum
- func (bn *BigNum) ToBigInt() *big.Int
- func (bn *BigNum) UnmarshalBinary(text []byte) error
- type Block
- type BlockHash
- type BlockType
- func (z *BlockType) DecodeMsg(dc *msgp.Reader) (err error)
- func (z BlockType) EncodeMsg(en *msgp.Writer) (err error)
- func (e BlockType) Equal(t BlockType) bool
- func (e BlockType) MarshalJSON() ([]byte, error)
- func (z BlockType) MarshalMsg(b []byte) (o []byte, err error)
- func (z BlockType) Msgsize() (s int)
- func (t BlockType) String() string
- func (e *BlockType) UnmarshalJSON(b []byte) error
- func (z *BlockType) UnmarshalMsg(bts []byte) (o []byte, err error)
- type ContractAbi
- func (z *ContractAbi) DecodeMsg(dc *msgp.Reader) (err error)
- func (z *ContractAbi) EncodeMsg(en *msgp.Writer) (err error)
- func (c *ContractAbi) ExtensionType() int8
- func (c *ContractAbi) Len() int
- func (c *ContractAbi) MarshalBinaryTo(text []byte) error
- func (z *ContractAbi) MarshalMsg(b []byte) (o []byte, err error)
- func (z *ContractAbi) Msgsize() (s int)
- func (c *ContractAbi) UnmarshalBinary(text []byte) error
- func (z *ContractAbi) UnmarshalMsg(bts []byte) (o []byte, err error)
- type Convert
- type Frontier
- func (z *Frontier) DecodeMsg(dc *msgp.Reader) (err error)
- func (f *Frontier) Deserialize(text []byte) error
- func (z Frontier) EncodeMsg(en *msgp.Writer) (err error)
- func (f *Frontier) IsZero() bool
- func (z Frontier) MarshalMsg(b []byte) (o []byte, err error)
- func (z Frontier) Msgsize() (s int)
- func (f *Frontier) Serialize() ([]byte, error)
- func (z *Frontier) UnmarshalMsg(bts []byte) (o []byte, err error)
- type FrontierBlock
- func (z *FrontierBlock) DecodeMsg(dc *msgp.Reader) (err error)
- func (fb *FrontierBlock) Deserialize(text []byte) error
- func (z *FrontierBlock) EncodeMsg(en *msgp.Writer) (err error)
- func (z *FrontierBlock) MarshalMsg(b []byte) (o []byte, err error)
- func (z *FrontierBlock) Msgsize() (s int)
- func (fb *FrontierBlock) Serialize() ([]byte, error)
- func (z *FrontierBlock) UnmarshalMsg(bts []byte) (o []byte, err error)
- type Frontiers
- func (z *Frontiers) DecodeMsg(dc *msgp.Reader) (err error)
- func (z Frontiers) EncodeMsg(en *msgp.Writer) (err error)
- func (fs Frontiers) Len() int
- func (fs Frontiers) Less(i, j int) bool
- func (z Frontiers) MarshalMsg(b []byte) (o []byte, err error)
- func (z Frontiers) Msgsize() (s int)
- func (fs Frontiers) Swap(i, j int)
- func (z *Frontiers) UnmarshalMsg(bts []byte) (o []byte, err error)
- type GapDoDSettleStateBlockWalkFunc
- type GapPovBlockWalkFunc
- type GapPublishBlockWalkFunc
- type GenericK
- type GenericKey
- type GenericKeyC
- type GenericT
- type GenericType
- type GenericTypeC
- type GenesisTokenInfo
- type Hash
- func BigToHash(num *big.Int) *Hash
- func BytesToHash(data []byte) (Hash, error)
- func HashBytes(inputs ...[]byte) (Hash, error)
- func HashData(data []byte) Hash
- func HybridHashData(data []byte) Hash
- func NewHash(hexStr string) (Hash, error)
- func ScryptHashBytes(inputs ...[]byte) (Hash, error)
- func ScryptHashData(data []byte) Hash
- func Sha256DHashBytes(inputs ...[]byte) (Hash, error)
- func Sha256DHashData(data []byte) Hash
- func Sha256HashData(data []byte) (Hash, error)
- func X11HashData(data []byte) Hash
- func (h Hash) Bytes() []byte
- func (h Hash) Cmp(h2 Hash) int
- func (z *Hash) DecodeMsg(dc *msgp.Reader) (err error)
- func (h *Hash) Deserialize(text []byte) error
- func (z *Hash) EncodeMsg(en *msgp.Writer) (err error)
- func (h *Hash) ExtensionType() int8
- func (h *Hash) FromBigInt(num *big.Int) error
- func (h *Hash) IsZero() bool
- func (h *Hash) Len() int
- func (h Hash) MarshalBinaryTo(text []byte) error
- func (z *Hash) MarshalMsg(b []byte) (o []byte, err error)
- func (h Hash) MarshalText() (text []byte, err error)
- func (z *Hash) Msgsize() (s int)
- func (h *Hash) Of(hexString string) error
- func (h Hash) ReverseByte() Hash
- func (h Hash) ReverseEndian() Hash
- func (h *Hash) Serialize() ([]byte, error)
- func (h Hash) String() string
- func (h *Hash) ToBigInt() *big.Int
- func (h *Hash) UnmarshalBinary(text []byte) error
- func (z *Hash) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (h *Hash) UnmarshalText(text []byte) error
- type HexBytes
- func (hbs HexBytes) Bytes() []byte
- func (z *HexBytes) DecodeMsg(dc *msgp.Reader) (err error)
- func (z HexBytes) EncodeMsg(en *msgp.Writer) (err error)
- func (hbs HexBytes) ExtensionType() int8
- func (hbs HexBytes) Len() int
- func (hbs HexBytes) MarshalBinaryTo(text []byte) error
- func (z HexBytes) MarshalMsg(b []byte) (o []byte, err error)
- func (hbs HexBytes) MarshalText() (text []byte, err error)
- func (z HexBytes) Msgsize() (s int)
- func (hbs *HexBytes) SetHex(hexString string) error
- func (hbs HexBytes) String() string
- func (hbs *HexBytes) UnmarshalBinary(text []byte) error
- func (z *HexBytes) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (hbs *HexBytes) UnmarshalText(text []byte) error
- type PeerInfo
- func (z *PeerInfo) DecodeMsg(dc *msgp.Reader) (err error)
- func (p *PeerInfo) Deserialize(text []byte) error
- func (z *PeerInfo) EncodeMsg(en *msgp.Writer) (err error)
- func (z *PeerInfo) MarshalMsg(b []byte) (o []byte, err error)
- func (z *PeerInfo) Msgsize() (s int)
- func (p *PeerInfo) Serialize() ([]byte, error)
- func (z *PeerInfo) UnmarshalMsg(bts []byte) (o []byte, err error)
- type PendingInfo
- func (z *PendingInfo) DecodeMsg(dc *msgp.Reader) (err error)
- func (pi *PendingInfo) Deserialize(text []byte) error
- func (z PendingInfo) EncodeMsg(en *msgp.Writer) (err error)
- func (z PendingInfo) MarshalMsg(b []byte) (o []byte, err error)
- func (z PendingInfo) Msgsize() (s int)
- func (pi *PendingInfo) Serialize() ([]byte, error)
- func (z *PendingInfo) UnmarshalMsg(bts []byte) (o []byte, err error)
- type PendingKey
- func (z *PendingKey) DecodeMsg(dc *msgp.Reader) (err error)
- func (pk *PendingKey) Deserialize(text []byte) error
- func (z PendingKey) EncodeMsg(en *msgp.Writer) (err error)
- func (z PendingKey) MarshalMsg(b []byte) (o []byte, err error)
- func (z PendingKey) Msgsize() (s int)
- func (pk *PendingKey) Serialize() ([]byte, error)
- func (z *PendingKey) UnmarshalMsg(bts []byte) (o []byte, err error)
- type PendingKind
- type PovAccountState
- func (as *PovAccountState) Clone() *PovAccountState
- func (z *PovAccountState) DecodeMsg(dc *msgp.Reader) (err error)
- func (as *PovAccountState) Deserialize(text []byte) error
- func (z *PovAccountState) EncodeMsg(en *msgp.Writer) (err error)
- func (as *PovAccountState) GetTokenState(tokenType Hash) *PovTokenState
- func (z *PovAccountState) MarshalMsg(b []byte) (o []byte, err error)
- func (z *PovAccountState) Msgsize() (s int)
- func (as *PovAccountState) Serialize() ([]byte, error)
- func (as *PovAccountState) String() string
- func (as *PovAccountState) TotalBalance() Balance
- func (z *PovAccountState) UnmarshalMsg(bts []byte) (o []byte, err error)
- type PovAlgoType
- type PovAuxHeader
- func (ah *PovAuxHeader) ComputePowHash(algo PovAlgoType) Hash
- func (z *PovAuxHeader) DecodeMsg(dc *msgp.Reader) (err error)
- func (ah *PovAuxHeader) Deserialize(text []byte) error
- func (z *PovAuxHeader) EncodeMsg(en *msgp.Writer) (err error)
- func (z *PovAuxHeader) MarshalMsg(b []byte) (o []byte, err error)
- func (z *PovAuxHeader) Msgsize() (s int)
- func (ah *PovAuxHeader) Serialize() ([]byte, error)
- func (z *PovAuxHeader) UnmarshalMsg(bts []byte) (o []byte, err error)
- type PovBaseHeader
- func (z *PovBaseHeader) DecodeMsg(dc *msgp.Reader) (err error)
- func (bh *PovBaseHeader) Deserialize(text []byte) error
- func (z *PovBaseHeader) EncodeMsg(en *msgp.Writer) (err error)
- func (z *PovBaseHeader) MarshalMsg(b []byte) (o []byte, err error)
- func (z *PovBaseHeader) Msgsize() (s int)
- func (bh *PovBaseHeader) Serialize() ([]byte, error)
- func (z *PovBaseHeader) UnmarshalMsg(bts []byte) (o []byte, err error)
- type PovBlock
- func (blk *PovBlock) Clone() *PovBlock
- func (blk *PovBlock) ComputeHash() Hash
- func (blk *PovBlock) Copy() *PovBlock
- func (z *PovBlock) DecodeMsg(dc *msgp.Reader) (err error)
- func (blk *PovBlock) Deserialize(text []byte) error
- func (z *PovBlock) EncodeMsg(en *msgp.Writer) (err error)
- func (blk *PovBlock) GetAccountTxs() []*PovTransaction
- func (blk *PovBlock) GetAlgoEfficiency() uint
- func (blk *PovBlock) GetAlgoType() PovAlgoType
- func (blk *PovBlock) GetAllTxs() []*PovTransaction
- func (blk *PovBlock) GetBits() uint32
- func (blk *PovBlock) GetBody() *PovBody
- func (blk *PovBlock) GetCoinBaseTx() *PovTransaction
- func (blk *PovBlock) GetHash() Hash
- func (blk *PovBlock) GetHeader() *PovHeader
- func (blk *PovBlock) GetHeight() uint64
- func (blk *PovBlock) GetMerkleRoot() Hash
- func (blk *PovBlock) GetMinerAddr() Address
- func (blk *PovBlock) GetPrevious() Hash
- func (blk *PovBlock) GetStateHash() Hash
- func (blk *PovBlock) GetTimestamp() uint32
- func (blk *PovBlock) GetTxByIndex(index int) *PovTransaction
- func (blk *PovBlock) GetTxNum() uint32
- func (blk *PovBlock) GetVersion() uint32
- func (z *PovBlock) MarshalMsg(b []byte) (o []byte, err error)
- func (z *PovBlock) Msgsize() (s int)
- func (blk *PovBlock) Serialize() ([]byte, error)
- func (blk *PovBlock) String() string
- func (z *PovBlock) UnmarshalMsg(bts []byte) (o []byte, err error)
- type PovBlockFrom
- type PovBlocks
- func (z *PovBlocks) DecodeMsg(dc *msgp.Reader) (err error)
- func (bs *PovBlocks) Deserialize(text []byte) error
- func (z PovBlocks) EncodeMsg(en *msgp.Writer) (err error)
- func (z PovBlocks) MarshalMsg(b []byte) (o []byte, err error)
- func (z PovBlocks) Msgsize() (s int)
- func (bs *PovBlocks) Serialize() ([]byte, error)
- func (z *PovBlocks) UnmarshalMsg(bts []byte) (o []byte, err error)
- type PovBody
- func (b *PovBody) Copy() *PovBody
- func (z *PovBody) DecodeMsg(dc *msgp.Reader) (err error)
- func (b *PovBody) Deserialize(text []byte) error
- func (z *PovBody) EncodeMsg(en *msgp.Writer) (err error)
- func (z *PovBody) MarshalMsg(b []byte) (o []byte, err error)
- func (z *PovBody) Msgsize() (s int)
- func (b *PovBody) Serialize() ([]byte, error)
- func (z *PovBody) UnmarshalMsg(bts []byte) (o []byte, err error)
- type PovBtcHeader
- func (h *PovBtcHeader) BuildHashData() []byte
- func (h *PovBtcHeader) ComputeHash() Hash
- func (h *PovBtcHeader) ComputePowHash(algo PovAlgoType) Hash
- func (z *PovBtcHeader) DecodeMsg(dc *msgp.Reader) (err error)
- func (h *PovBtcHeader) Deserialize(text []byte) error
- func (z *PovBtcHeader) EncodeMsg(en *msgp.Writer) (err error)
- func (z *PovBtcHeader) MarshalMsg(b []byte) (o []byte, err error)
- func (z *PovBtcHeader) Msgsize() (s int)
- func (h *PovBtcHeader) Serialize() ([]byte, error)
- func (z *PovBtcHeader) UnmarshalMsg(bts []byte) (o []byte, err error)
- type PovBtcOutPoint
- func (z *PovBtcOutPoint) DecodeMsg(dc *msgp.Reader) (err error)
- func (p *PovBtcOutPoint) Deserialize(text []byte) error
- func (z PovBtcOutPoint) EncodeMsg(en *msgp.Writer) (err error)
- func (z PovBtcOutPoint) MarshalMsg(b []byte) (o []byte, err error)
- func (z PovBtcOutPoint) Msgsize() (s int)
- func (p *PovBtcOutPoint) Serialize() ([]byte, error)
- func (z *PovBtcOutPoint) UnmarshalMsg(bts []byte) (o []byte, err error)
- type PovBtcTx
- func (tx *PovBtcTx) BuildHashData() []byte
- func (tx *PovBtcTx) ComputeHash() Hash
- func (z *PovBtcTx) DecodeMsg(dc *msgp.Reader) (err error)
- func (tx *PovBtcTx) Deserialize(text []byte) error
- func (z *PovBtcTx) EncodeMsg(en *msgp.Writer) (err error)
- func (z *PovBtcTx) MarshalMsg(b []byte) (o []byte, err error)
- func (z *PovBtcTx) Msgsize() (s int)
- func (tx *PovBtcTx) Serialize() ([]byte, error)
- func (z *PovBtcTx) UnmarshalMsg(bts []byte) (o []byte, err error)
- type PovBtcTxIn
- func (ti *PovBtcTxIn) BuildHashData() []byte
- func (z *PovBtcTxIn) DecodeMsg(dc *msgp.Reader) (err error)
- func (ti *PovBtcTxIn) Deserialize(text []byte) error
- func (z *PovBtcTxIn) EncodeMsg(en *msgp.Writer) (err error)
- func (z *PovBtcTxIn) MarshalMsg(b []byte) (o []byte, err error)
- func (z *PovBtcTxIn) Msgsize() (s int)
- func (ti *PovBtcTxIn) Serialize() ([]byte, error)
- func (z *PovBtcTxIn) UnmarshalMsg(bts []byte) (o []byte, err error)
- type PovBtcTxOut
- func (to *PovBtcTxOut) BuildHashData() []byte
- func (z *PovBtcTxOut) DecodeMsg(dc *msgp.Reader) (err error)
- func (to *PovBtcTxOut) Deserialize(text []byte) error
- func (z *PovBtcTxOut) EncodeMsg(en *msgp.Writer) (err error)
- func (z *PovBtcTxOut) MarshalMsg(b []byte) (o []byte, err error)
- func (z *PovBtcTxOut) Msgsize() (s int)
- func (to *PovBtcTxOut) Serialize() ([]byte, error)
- func (z *PovBtcTxOut) UnmarshalMsg(bts []byte) (o []byte, err error)
- type PovCoinBaseTx
- func (cbtx *PovCoinBaseTx) BuildHashData() []byte
- func (cbtx *PovCoinBaseTx) ComputeHash() Hash
- func (cbtx *PovCoinBaseTx) Copy() *PovCoinBaseTx
- func (z *PovCoinBaseTx) DecodeMsg(dc *msgp.Reader) (err error)
- func (cbtx *PovCoinBaseTx) Deserialize(text []byte) error
- func (z *PovCoinBaseTx) EncodeMsg(en *msgp.Writer) (err error)
- func (cbtx *PovCoinBaseTx) GetCoinBaseData1() []byte
- func (cbtx *PovCoinBaseTx) GetCoinBaseData2() []byte
- func (cbtx *PovCoinBaseTx) GetHash() Hash
- func (cbtx *PovCoinBaseTx) GetMinerTxOut() *PovCoinBaseTxOut
- func (cbtx *PovCoinBaseTx) GetRepTxOut() *PovCoinBaseTxOut
- func (z *PovCoinBaseTx) MarshalMsg(b []byte) (o []byte, err error)
- func (z *PovCoinBaseTx) Msgsize() (s int)
- func (cbtx *PovCoinBaseTx) Serialize() ([]byte, error)
- func (z *PovCoinBaseTx) UnmarshalMsg(bts []byte) (o []byte, err error)
- type PovCoinBaseTxIn
- func (ti *PovCoinBaseTxIn) Copy() *PovCoinBaseTxIn
- func (z *PovCoinBaseTxIn) DecodeMsg(dc *msgp.Reader) (err error)
- func (ti *PovCoinBaseTxIn) Deserialize(text []byte) error
- func (z *PovCoinBaseTxIn) EncodeMsg(en *msgp.Writer) (err error)
- func (z *PovCoinBaseTxIn) MarshalMsg(b []byte) (o []byte, err error)
- func (z *PovCoinBaseTxIn) Msgsize() (s int)
- func (ti *PovCoinBaseTxIn) Serialize() ([]byte, error)
- func (z *PovCoinBaseTxIn) UnmarshalMsg(bts []byte) (o []byte, err error)
- type PovCoinBaseTxOut
- func (to *PovCoinBaseTxOut) Copy() *PovCoinBaseTxOut
- func (z *PovCoinBaseTxOut) DecodeMsg(dc *msgp.Reader) (err error)
- func (to *PovCoinBaseTxOut) Deserialize(text []byte) error
- func (z PovCoinBaseTxOut) EncodeMsg(en *msgp.Writer) (err error)
- func (z PovCoinBaseTxOut) MarshalMsg(b []byte) (o []byte, err error)
- func (z PovCoinBaseTxOut) Msgsize() (s int)
- func (to *PovCoinBaseTxOut) Serialize() ([]byte, error)
- func (z *PovCoinBaseTxOut) UnmarshalMsg(bts []byte) (o []byte, err error)
- type PovContractState
- func (z *PovContractState) DecodeMsg(dc *msgp.Reader) (err error)
- func (cs *PovContractState) Deserialize(text []byte) error
- func (z PovContractState) EncodeMsg(en *msgp.Writer) (err error)
- func (z PovContractState) MarshalMsg(b []byte) (o []byte, err error)
- func (z PovContractState) Msgsize() (s int)
- func (cs *PovContractState) Serialize() ([]byte, error)
- func (z *PovContractState) UnmarshalMsg(bts []byte) (o []byte, err error)
- type PovDiffDayStat
- func (z *PovDiffDayStat) DecodeMsg(dc *msgp.Reader) (err error)
- func (ds *PovDiffDayStat) Deserialize(text []byte) error
- func (z *PovDiffDayStat) EncodeMsg(en *msgp.Writer) (err error)
- func (z *PovDiffDayStat) MarshalMsg(b []byte) (o []byte, err error)
- func (z *PovDiffDayStat) Msgsize() (s int)
- func (ds *PovDiffDayStat) Serialize() ([]byte, error)
- func (z *PovDiffDayStat) UnmarshalMsg(bts []byte) (o []byte, err error)
- type PovHeader
- func (h *PovHeader) BuildHashData() []byte
- func (h *PovHeader) ComputeHash() Hash
- func (h *PovHeader) ComputePowHash() Hash
- func (h *PovHeader) Copy() *PovHeader
- func (z *PovHeader) DecodeMsg(dc *msgp.Reader) (err error)
- func (h *PovHeader) Deserialize(text []byte) error
- func (z *PovHeader) EncodeMsg(en *msgp.Writer) (err error)
- func (h *PovHeader) GetAlgoEfficiency() uint
- func (h *PovHeader) GetAlgoTargetInt() *big.Int
- func (h *PovHeader) GetAlgoType() PovAlgoType
- func (h *PovHeader) GetBits() uint32
- func (h *PovHeader) GetHash() Hash
- func (h *PovHeader) GetHeight() uint64
- func (h *PovHeader) GetMinerAddr() Address
- func (h *PovHeader) GetMinerReward() Balance
- func (h *PovHeader) GetNonce() uint32
- func (h *PovHeader) GetNormBits() uint32
- func (h *PovHeader) GetNormTargetInt() *big.Int
- func (h *PovHeader) GetPrevious() Hash
- func (h *PovHeader) GetRepAddr() Address
- func (h *PovHeader) GetRepReward() Balance
- func (h *PovHeader) GetStateHash() Hash
- func (h *PovHeader) GetTimestamp() uint32
- func (h *PovHeader) GetTxNum() uint32
- func (h *PovHeader) GetVersion() uint32
- func (z *PovHeader) MarshalMsg(b []byte) (o []byte, err error)
- func (z *PovHeader) Msgsize() (s int)
- func (h *PovHeader) Serialize() ([]byte, error)
- func (z *PovHeader) UnmarshalMsg(bts []byte) (o []byte, err error)
- type PovMineBlock
- type PovMineResult
- type PovMineWork
- type PovMinerDayStat
- func (z *PovMinerDayStat) DecodeMsg(dc *msgp.Reader) (err error)
- func (mds *PovMinerDayStat) Deserialize(text []byte) error
- func (z *PovMinerDayStat) EncodeMsg(en *msgp.Writer) (err error)
- func (z *PovMinerDayStat) MarshalMsg(b []byte) (o []byte, err error)
- func (z *PovMinerDayStat) Msgsize() (s int)
- func (mds *PovMinerDayStat) Serialize() ([]byte, error)
- func (z *PovMinerDayStat) UnmarshalMsg(bts []byte) (o []byte, err error)
- type PovMinerStatItem
- func (z *PovMinerStatItem) DecodeMsg(dc *msgp.Reader) (err error)
- func (msi *PovMinerStatItem) Deserialize(text []byte) error
- func (z *PovMinerStatItem) EncodeMsg(en *msgp.Writer) (err error)
- func (z *PovMinerStatItem) MarshalMsg(b []byte) (o []byte, err error)
- func (z *PovMinerStatItem) Msgsize() (s int)
- func (msi *PovMinerStatItem) Serialize() ([]byte, error)
- func (z *PovMinerStatItem) UnmarshalMsg(bts []byte) (o []byte, err error)
- type PovPublishState
- func (z *PovPublishState) DecodeMsg(dc *msgp.Reader) (err error)
- func (ps *PovPublishState) Deserialize(text []byte) error
- func (z *PovPublishState) EncodeMsg(en *msgp.Writer) (err error)
- func (z *PovPublishState) MarshalMsg(b []byte) (o []byte, err error)
- func (z *PovPublishState) Msgsize() (s int)
- func (ps *PovPublishState) Serialize() ([]byte, error)
- func (z *PovPublishState) UnmarshalMsg(bts []byte) (o []byte, err error)
- type PovRepState
- func (rs *PovRepState) CalcTotal() Balance
- func (rs *PovRepState) Clone() *PovRepState
- func (z *PovRepState) DecodeMsg(dc *msgp.Reader) (err error)
- func (rs *PovRepState) Deserialize(text []byte) error
- func (z *PovRepState) EncodeMsg(en *msgp.Writer) (err error)
- func (z *PovRepState) MarshalMsg(b []byte) (o []byte, err error)
- func (z *PovRepState) Msgsize() (s int)
- func (rs *PovRepState) Serialize() ([]byte, error)
- func (rs *PovRepState) String() string
- func (z *PovRepState) UnmarshalMsg(bts []byte) (o []byte, err error)
- type PovTD
- func (td *PovTD) Copy() *PovTD
- func (z *PovTD) DecodeMsg(dc *msgp.Reader) (err error)
- func (td *PovTD) Deserialize(text []byte) error
- func (z *PovTD) EncodeMsg(en *msgp.Writer) (err error)
- func (z *PovTD) MarshalMsg(b []byte) (o []byte, err error)
- func (z *PovTD) Msgsize() (s int)
- func (td *PovTD) Serialize() ([]byte, error)
- func (z *PovTD) UnmarshalMsg(bts []byte) (o []byte, err error)
- type PovTokenState
- func (ts *PovTokenState) Clone() *PovTokenState
- func (z *PovTokenState) DecodeMsg(dc *msgp.Reader) (err error)
- func (ts *PovTokenState) Deserialize(text []byte) error
- func (z *PovTokenState) EncodeMsg(en *msgp.Writer) (err error)
- func (z *PovTokenState) MarshalMsg(b []byte) (o []byte, err error)
- func (z *PovTokenState) Msgsize() (s int)
- func (ts *PovTokenState) Serialize() ([]byte, error)
- func (ts *PovTokenState) String() string
- func (z *PovTokenState) UnmarshalMsg(bts []byte) (o []byte, err error)
- type PovTransaction
- func (tx *PovTransaction) Copy() *PovTransaction
- func (z *PovTransaction) DecodeMsg(dc *msgp.Reader) (err error)
- func (tx *PovTransaction) Deserialize(text []byte) error
- func (z PovTransaction) EncodeMsg(en *msgp.Writer) (err error)
- func (tx *PovTransaction) GetHash() Hash
- func (tx *PovTransaction) IsCbTx() bool
- func (z PovTransaction) MarshalMsg(b []byte) (o []byte, err error)
- func (z PovTransaction) Msgsize() (s int)
- func (tx *PovTransaction) Serialize() ([]byte, error)
- func (z *PovTransaction) UnmarshalMsg(bts []byte) (o []byte, err error)
- type PovTransactions
- type PovTxByHash
- type PovTxLookup
- func (z *PovTxLookup) DecodeMsg(dc *msgp.Reader) (err error)
- func (txl *PovTxLookup) Deserialize(text []byte) error
- func (z PovTxLookup) EncodeMsg(en *msgp.Writer) (err error)
- func (z PovTxLookup) MarshalMsg(b []byte) (o []byte, err error)
- func (z PovTxLookup) Msgsize() (s int)
- func (txl *PovTxLookup) Serialize() ([]byte, error)
- func (z *PovTxLookup) UnmarshalMsg(bts []byte) (o []byte, err error)
- type PovVerifierState
- func (z *PovVerifierState) DecodeMsg(dc *msgp.Reader) (err error)
- func (vs *PovVerifierState) Deserialize(text []byte) error
- func (z *PovVerifierState) EncodeMsg(en *msgp.Writer) (err error)
- func (z *PovVerifierState) MarshalMsg(b []byte) (o []byte, err error)
- func (z *PovVerifierState) Msgsize() (s int)
- func (vs *PovVerifierState) Serialize() ([]byte, error)
- func (z *PovVerifierState) UnmarshalMsg(bts []byte) (o []byte, err error)
- type Schema
- type Seed
- func (s *Seed) Account(index uint32) (*Account, error)
- func (z *Seed) DecodeMsg(dc *msgp.Reader) (err error)
- func (z *Seed) EncodeMsg(en *msgp.Writer) (err error)
- func (s *Seed) ExtensionType() int8
- func (s *Seed) IsZero() bool
- func (s *Seed) Len() int
- func (s Seed) MarshalBinaryTo(text []byte) error
- func (s Seed) MarshalJSON() ([]byte, error)
- func (z *Seed) MarshalMsg(b []byte) (o []byte, err error)
- func (s *Seed) MasterAddress() Address
- func (z *Seed) Msgsize() (s int)
- func (s Seed) String() string
- func (s *Seed) UnmarshalBinary(text []byte) error
- func (z *Seed) UnmarshalMsg(bts []byte) (o []byte, err error)
- type Serializer
- type Signature
- func (s Signature) Bytes() []byte
- func (s *Signature) ExtensionType() int8
- func (s *Signature) FromBigInt(num *big.Int) error
- func (s *Signature) IsZero() bool
- func (s *Signature) Len() int
- func (s Signature) MarshalBinaryTo(text []byte) error
- func (s Signature) MarshalText() (text []byte, err error)
- func (s *Signature) Of(hexString string) error
- func (s Signature) String() string
- func (s *Signature) ToBigInt() *big.Int
- func (s *Signature) UnmarshalBinary(text []byte) error
- func (s *Signature) UnmarshalText(text []byte) error
- type SmartContractBlock
- func (z *SmartContractBlock) DecodeMsg(dc *msgp.Reader) (err error)
- func (sc *SmartContractBlock) Deserialize(text []byte) error
- func (z *SmartContractBlock) EncodeMsg(en *msgp.Writer) (err error)
- func (sc *SmartContractBlock) GetHash() Hash
- func (sc *SmartContractBlock) IsValid() bool
- func (z *SmartContractBlock) MarshalMsg(b []byte) (o []byte, err error)
- func (z *SmartContractBlock) Msgsize() (s int)
- func (sc *SmartContractBlock) Serialize() ([]byte, error)
- func (sc *SmartContractBlock) Size() int
- func (sc *SmartContractBlock) String() string
- func (z *SmartContractBlock) UnmarshalMsg(bts []byte) (o []byte, err error)
- type StateBlock
- func (b *StateBlock) BuildHashData() []byte
- func (b *StateBlock) CheckPrivateRecvRsp() error
- func (b *StateBlock) Clone() *StateBlock
- func (b *StateBlock) ConvertToSchema() ([]Schema, error)
- func (z *StateBlock) DecodeMsg(dc *msgp.Reader) (err error)
- func (b *StateBlock) Deserialize(text []byte) error
- func (z *StateBlock) EncodeMsg(en *msgp.Writer) (err error)
- func (b *StateBlock) GetAddress() Address
- func (b *StateBlock) GetBalance() Balance
- func (b *StateBlock) GetData() []byte
- func (b *StateBlock) GetExtra() Hash
- func (b *StateBlock) GetHash() Hash
- func (b *StateBlock) GetHashWithoutPrivacy() Hash
- func (b *StateBlock) GetLink() Hash
- func (b *StateBlock) GetMessage() Hash
- func (b *StateBlock) GetNetwork() Balance
- func (b *StateBlock) GetOracle() Balance
- func (b *StateBlock) GetPayload() []byte
- func (b *StateBlock) GetPrevious() Hash
- func (b *StateBlock) GetPrivatePayload() []byte
- func (b *StateBlock) GetReceiver() []byte
- func (b *StateBlock) GetRepresentative() Address
- func (b *StateBlock) GetSender() []byte
- func (b *StateBlock) GetSignature() Signature
- func (b *StateBlock) GetStorage() Balance
- func (b *StateBlock) GetTimestamp() int64
- func (b *StateBlock) GetToken() Hash
- func (b *StateBlock) GetType() BlockType
- func (b *StateBlock) GetVote() Balance
- func (b *StateBlock) GetWork() Work
- func (b *StateBlock) IsContractBlock() bool
- func (b *StateBlock) IsFromSync() bool
- func (b *StateBlock) IsOpen() bool
- func (b *StateBlock) IsPrivate() bool
- func (b *StateBlock) IsReceiveBlock() bool
- func (b *StateBlock) IsRecipient() bool
- func (b *StateBlock) IsSendBlock() bool
- func (b *StateBlock) IsValid() bool
- func (z *StateBlock) MarshalMsg(b []byte) (o []byte, err error)
- func (z *StateBlock) Msgsize() (s int)
- func (b *StateBlock) Parent() Hash
- func (b *StateBlock) Root() Hash
- func (b *StateBlock) Serialize() ([]byte, error)
- func (b *StateBlock) SetFromSync()
- func (b *StateBlock) SetPrivatePayload(rawData []byte)
- func (b *StateBlock) Size() int
- func (b *StateBlock) String() string
- func (b *StateBlock) TotalBalance() Balance
- func (z *StateBlock) UnmarshalMsg(bts []byte) (o []byte, err error)
- type StateBlockList
- func (z *StateBlockList) DecodeMsg(dc *msgp.Reader) (err error)
- func (bs *StateBlockList) Deserialize(text []byte) error
- func (z StateBlockList) EncodeMsg(en *msgp.Writer) (err error)
- func (z StateBlockList) MarshalMsg(b []byte) (o []byte, err error)
- func (z StateBlockList) Msgsize() (s int)
- func (bs *StateBlockList) Serialize() ([]byte, error)
- func (z *StateBlockList) UnmarshalMsg(bts []byte) (o []byte, err error)
- type SynchronizedKind
- func (z *SynchronizedKind) DecodeMsg(dc *msgp.Reader) (err error)
- func (z SynchronizedKind) EncodeMsg(en *msgp.Writer) (err error)
- func (z SynchronizedKind) MarshalMsg(b []byte) (o []byte, err error)
- func (z SynchronizedKind) Msgsize() (s int)
- func (s SynchronizedKind) String() string
- func (z *SynchronizedKind) UnmarshalMsg(bts []byte) (o []byte, err error)
- type TokenInfo
- type TokenMeta
- func (tm *TokenMeta) Clone() *TokenMeta
- func (z *TokenMeta) DecodeMsg(dc *msgp.Reader) (err error)
- func (tm *TokenMeta) Deserialize(text []byte) error
- func (z *TokenMeta) EncodeMsg(en *msgp.Writer) (err error)
- func (z *TokenMeta) MarshalMsg(b []byte) (o []byte, err error)
- func (z *TokenMeta) Msgsize() (s int)
- func (tm *TokenMeta) Serialize() ([]byte, error)
- func (z *TokenMeta) UnmarshalMsg(bts []byte) (o []byte, err error)
- type TrieNode
- type Tuple
- type Unchecked
- func (z *Unchecked) DecodeMsg(dc *msgp.Reader) (err error)
- func (u *Unchecked) Deserialize(text []byte) error
- func (z *Unchecked) EncodeMsg(en *msgp.Writer) (err error)
- func (z *Unchecked) MarshalMsg(b []byte) (o []byte, err error)
- func (z *Unchecked) Msgsize() (s int)
- func (u *Unchecked) Serialize() ([]byte, error)
- func (u *Unchecked) String() string
- func (z *Unchecked) UnmarshalMsg(bts []byte) (o []byte, err error)
- type UncheckedBlockWalkFunc
- type UncheckedKind
- func (z *UncheckedKind) DecodeMsg(dc *msgp.Reader) (err error)
- func (z UncheckedKind) EncodeMsg(en *msgp.Writer) (err error)
- func (z UncheckedKind) MarshalMsg(b []byte) (o []byte, err error)
- func (z UncheckedKind) Msgsize() (s int)
- func (z *UncheckedKind) UnmarshalMsg(bts []byte) (o []byte, err error)
- type VmLog
- type VmLogs
- func (z *VmLogs) DecodeMsg(dc *msgp.Reader) (err error)
- func (v *VmLogs) Deserialize(text []byte) error
- func (z *VmLogs) EncodeMsg(en *msgp.Writer) (err error)
- func (vl *VmLogs) Hash() *Hash
- func (z *VmLogs) MarshalMsg(b []byte) (o []byte, err error)
- func (z *VmLogs) Msgsize() (s int)
- func (v *VmLogs) Serialize() ([]byte, error)
- func (z *VmLogs) UnmarshalMsg(bts []byte) (o []byte, err error)
- type Work
- func (w *Work) ExtensionType() int8
- func (w Work) IsValid(root Hash) bool
- func (w *Work) Len() int
- func (w *Work) MarshalBinaryTo(text []byte) error
- func (w Work) MarshalText() (text []byte, err error)
- func (w *Work) ParseWorkHexString(hexString string) error
- func (w Work) String() string
- func (w *Work) UnmarshalBinary(text []byte) error
- func (w *Work) UnmarshalText(text []byte) error
- type Worker
Constants ¶
const ( // AddressPrefix is the prefix of qlc addresses. AddressPrefix = "qlc_" // AddressSize represents the binary size of a qlc address (a public key). AddressSize = ed25519.PublicKeySize // AddressLen represents the string length of a qlc address. AddressLen = 60 )
const ( // BalanceMaxPrecision balance max precision BalanceMaxPrecision = 11 BalanceSize = 64 )
const ( PovTxVersion = 1 PovMaxTxInSequenceNum uint32 = 0xffffffff PovMaxPrevOutIndex uint32 = 0xffffffff )
const ( AddressExtensionType = 99 BalanceExtensionType = 100 HashExtensionType = 101 SeedExtensionType = 102 SignatureExtensionType = 103 WorkExtensionType = 104 AbiExtensionType = 105 BigNumExtensionType = 106 HexBytesExtensionType = 107 )
const ( ALGO_VERSION_MASK = PovAlgoType(255 << 8) ALGO_SHA256D = PovAlgoType(0 << 8) ALGO_SCRYPT = PovAlgoType(1 << 8) ALGO_NIST5 = PovAlgoType(2 << 8) ALGO_LYRA2Z = PovAlgoType(3 << 8) ALGO_X11 = PovAlgoType(4 << 8) ALGO_X16R = PovAlgoType(5 << 8) ALGO_HYBRID = PovAlgoType(254 << 8) ALGO_UNKNOWN = PovAlgoType(255 << 8) )
const ( // version bits scheme POV_VBS_TOPBITS = 0x20000000 POV_VBS_TOPMASK = 0xe0000000 )
const ( PovPublishStatusInit = 0 PovPublishStatusVerified = 1 )
const (
BlockFlagSync uint64 = 1 << iota
)
const (
FrontierSize = AddressSize + HashSize
)
const ( //HashSize size of hash HashSize = blake2b.Size256 )
const (
// SeedSize size of the seed
SeedSize = 32
)
const ( //SignatureSize size of signature SignatureSize = ed25519.SignatureSize )
const (
//WorkSize work size
WorkSize = 8
)
Variables ¶
var ( // ZeroAddress ZeroAddress = Address{} // AddressEncoding is a base32 encoding using addressEncodingAlphabet as its // alphabet. AddressEncoding = base32.NewEncoding(addressEncodingAlphabet) )
var ( ErrBadBlockType = errors.New("bad block type") ErrNotABlock = errors.New("block type is not_a_block") )
var ( PovAuxPowChainID = 1688 PovAuxPowHeaderMagic = []byte{0xfa, 0xbe, 'm', 'm'} )
var FFFFHash, _ = NewHash("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")
var WorkThreshold = uint64(0xfffffe0000000000)
var ( // ZeroBalance zero ZeroBalance = Balance{big.NewInt(0)} )
var ( // ZeroBalance zero ZeroBenefit = &Benefit{ Vote: ZeroBalance, Network: ZeroBalance, Storage: ZeroBalance, Oracle: ZeroBalance, Balance: ZeroBalance, Total: ZeroBalance, } )
var ZeroHash = Hash{}
var ZeroSignature = Signature{}
Functions ¶
func BigToCompact ¶ added in v1.3.0
BigToCompact converts a whole number N to a compact representation using an unsigned 32-bit number. The compact representation only provides 23 bits of precision, so values larger than (2^23 - 1) only encode the most significant digits of the number. See CompactToBig for details.
func CalcDifficultyRatio ¶ added in v1.3.0
CalcDifficultyRatio returns the proof-of-work difficulty as a multiple of the minimum difficulty using the passed bits field from the header of a block.
func CalcDifficultyRatioByBigInt ¶ added in v1.3.1
func CalcWorkBitsToBigInt ¶ added in v1.3.0
CalcWork calculates a work value from difficulty bits. Bitcoin increases the difficulty for generating a block by decreasing the value which the generated hash must be less than. This difficulty target is stored in each block header using a compact representation as described in the documentation for CompactToBig. The main chain is selected by choosing the chain that has the most proof of work (highest difficulty). Since a lower target difficulty value equates to higher actual difficulty, the work value which will be accumulated must be the inverse of the difficulty. Also, in order to avoid potential division by zero and really small floating point numbers, the result adds 1 to the denominator and multiplies the numerator by 2^256.
func CompactToBig ¶ added in v1.3.0
CompactToBig converts a compact representation of a whole number N to an unsigned 32-bit number. The representation is similar to IEEE754 floating point numbers.
Like IEEE754 floating point, there are three basic components: the sign, the exponent, and the mantissa. They are broken out as follows:
the most significant 8 bits represent the unsigned base 256 exponent
bit 23 (the 24th bit) represents the sign bit
the least significant 23 bits represent the mantissa
------------------------------------------------- | Exponent | Sign | Mantissa | ------------------------------------------------- | 8 bits [31-24] | 1 bit [23] | 23 bits [22-00] | -------------------------------------------------
The formula to calculate N is:
N = (-1^sign) * mantissa * 256^(exponent-3)
This compact form is only used in bitcoin to encode unsigned 256-bit numbers which represent difficulty targets, thus there really is not a need for a sign bit, but it is implemented here to stay consistent with bitcoind.
func HashToBig ¶ added in v1.3.0
HashToBig converts a Hash into a big.Int that can be used to perform math comparisons.
func IsValidHexAddress ¶
IsValidHexAddress check Hex address string is valid
func KeypairFromPrivateKey ¶
func KeypairFromPrivateKey(privateKey string) (ed25519.PublicKey, ed25519.PrivateKey)
KeypairFromPrivateKey generate key pair from private key
func KeypairFromSeed ¶
KeypairFromSeed generate key pair from seed
Types ¶
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
func NewAccount ¶
func NewAccount(key ed25519.PrivateKey) *Account
NewAccount creates a new account with the given private key.
func (Account) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (Account) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*Account) PrivateKey ¶ added in v0.0.5
func (a *Account) PrivateKey() ed25519.PrivateKey
type AccountMeta ¶
type AccountMeta struct { Address Address `msg:"account,extension" json:"account"` CoinBalance Balance `msg:"balance,extension" json:"balance"` CoinVote Balance `msg:"vote,extension" json:"vote"` CoinNetwork Balance `msg:"network,extension" json:"network"` CoinStorage Balance `msg:"storage,extension" json:"storage"` CoinOracle Balance `msg:"oracle,extension" json:"oracle"` Tokens []*TokenMeta `msg:"tokens" json:"tokens"` }
func (*AccountMeta) Clone ¶ added in v1.3.0
func (am *AccountMeta) Clone() *AccountMeta
func (*AccountMeta) DecodeMsg ¶
func (z *AccountMeta) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*AccountMeta) Deserialize ¶ added in v1.3.0
func (am *AccountMeta) Deserialize(text []byte) error
func (*AccountMeta) EncodeMsg ¶
func (z *AccountMeta) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*AccountMeta) GetBalance ¶ added in v1.1.1
func (a *AccountMeta) GetBalance() Balance
func (*AccountMeta) GetNetwork ¶ added in v1.1.1
func (a *AccountMeta) GetNetwork() Balance
func (*AccountMeta) GetOracle ¶ added in v1.1.1
func (a *AccountMeta) GetOracle() Balance
func (*AccountMeta) GetStorage ¶ added in v1.1.1
func (a *AccountMeta) GetStorage() Balance
func (*AccountMeta) GetVote ¶ added in v1.1.1
func (a *AccountMeta) GetVote() Balance
func (*AccountMeta) MarshalMsg ¶
func (z *AccountMeta) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*AccountMeta) Msgsize ¶
func (z *AccountMeta) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*AccountMeta) Serialize ¶ added in v1.3.0
func (am *AccountMeta) Serialize() ([]byte, error)
func (*AccountMeta) String ¶ added in v1.3.0
func (am *AccountMeta) String() string
func (*AccountMeta) Token ¶
func (am *AccountMeta) Token(tt Hash) *TokenMeta
Token get token meta by token type hash
func (*AccountMeta) TotalBalance ¶ added in v1.1.0
func (a *AccountMeta) TotalBalance() Balance
func (*AccountMeta) UnmarshalMsg ¶
func (z *AccountMeta) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
func (*AccountMeta) VoteWeight ¶ added in v1.1.0
func (a *AccountMeta) VoteWeight() Balance
type Address ¶
type Address [AddressSize]byte
Address of account
func BytesToAddress ¶
BytesToAddress convert byte array to Address
func GenerateAddress ¶
func GenerateAddress() (Address, ed25519.PrivateKey, error)
GenerateAddress generate qlc address
func HexToAddress ¶
HexToAddress convert hex address string to Address
func PubToAddress ¶
PubToAddress convert ed25519.PublicKey to Address
func (*Address) Deserialize ¶ added in v1.4.0
func (*Address) ExtensionType ¶
ExtensionType implements Extension.ExtensionType interface
func (Address) MarshalBinaryTo ¶
ExtensionType implements Extension.MarshalBinaryTo interface
func (*Address) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (Address) MarshalText ¶
MarshalText implements encoding.Textmarshaler
func (*Address) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*Address) UnmarshalBinary ¶
ExtensionType implements Extension.UnmarshalBinary interface
func (*Address) UnmarshalMsg ¶
UnmarshalMsg implements msgp.Unmarshaler
func (*Address) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler
type AddressToken ¶ added in v1.2.3
func (AddressToken) String ¶ added in v1.2.3
func (at AddressToken) String() string
type Balance ¶
Balance of account
func BytesToBalance ¶
BytesToBalance create balance from byte slice
func NewBalance ¶ added in v1.2.3
func NewBalanceFromBigInt ¶ added in v1.3.0
func StringToBalance ¶
StringToBalance create balance from string
func (Balance) Bytes ¶
Bytes returns the binary representation of this Balance with the given endianness.
func (*Balance) ExtensionType ¶
ExtensionType implements Extension.ExtensionType interface
func (*Balance) MarshalBinaryTo ¶
ExtensionType implements Extension.UnmarshalBinary interface
func (Balance) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (Balance) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*Balance) UnmarshalBinary ¶
ExtensionType implements Extension.UnmarshalBinary interface
func (*Balance) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
func (*Balance) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
type BalanceComp ¶
type BalanceComp byte
BalanceComp compare
const ( //BalanceCompEqual equal compare BalanceCompEqual BalanceComp = iota //BalanceCompBigger bigger compare BalanceCompBigger //BalanceCompSmaller smaller compare BalanceCompSmaller )
type Benefit ¶ added in v1.1.0
type Benefit struct { Balance Balance `msg:"balance,extension" json:"balance"` Vote Balance `msg:"vote,extension" json:"vote"` Network Balance `msg:"network,extension" json:"network"` Storage Balance `msg:"storage,extension" json:"storage"` Oracle Balance `msg:"oracle,extension" json:"oracle"` Total Balance `msg:"total,extension" json:"total"` }
func (*Benefit) Deserialize ¶ added in v1.3.0
func (*Benefit) MarshalMsg ¶ added in v1.1.0
MarshalMsg implements msgp.Marshaler
type BigNum ¶ added in v1.3.0
func CalcWorkBitsToBigNum ¶ added in v1.3.0
func CalcWorkIntToBigNum ¶ added in v1.3.0
func NewBigNumFromBigInt ¶ added in v1.3.0
func NewBigNumFromInt ¶ added in v1.4.0
func NewBigNumFromUint ¶ added in v1.4.0
func (*BigNum) ExtensionType ¶ added in v1.3.0
ExtensionType implements Extension.ExtensionType interface
func (*BigNum) MarshalBinaryTo ¶ added in v1.3.0
ExtensionType implements Extension.UnmarshalBinary interface
func (*BigNum) UnmarshalBinary ¶ added in v1.3.0
ExtensionType implements Extension.UnmarshalBinary interface
type BlockHash ¶ added in v1.4.0
type BlockType ¶
type BlockType byte
func BlockTypeFromStr ¶ added in v1.4.0
func (BlockType) MarshalJSON ¶
func (BlockType) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (BlockType) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*BlockType) UnmarshalJSON ¶
type ContractAbi ¶
type ContractAbi struct { Abi []byte `msg:"abi" json:"abi"` AbiLength uint64 `msg:"abiLength" json:"abiLength"` AbiHash Hash `msg:"abiHash,extension" json:"abiHash"` }
func (*ContractAbi) DecodeMsg ¶
func (z *ContractAbi) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*ContractAbi) EncodeMsg ¶
func (z *ContractAbi) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*ContractAbi) ExtensionType ¶
func (c *ContractAbi) ExtensionType() int8
ExtensionType implements Extension.ExtensionType interface
func (*ContractAbi) Len ¶
func (c *ContractAbi) Len() int
ExtensionType implements Extension.Len interface
func (*ContractAbi) MarshalBinaryTo ¶
func (c *ContractAbi) MarshalBinaryTo(text []byte) error
ExtensionType implements Extension.MarshalBinaryTo interface
func (*ContractAbi) MarshalMsg ¶
func (z *ContractAbi) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*ContractAbi) Msgsize ¶
func (z *ContractAbi) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*ContractAbi) UnmarshalBinary ¶
func (c *ContractAbi) UnmarshalBinary(text []byte) error
ExtensionType implements Extension.UnmarshalBinary interface
func (*ContractAbi) UnmarshalMsg ¶
func (z *ContractAbi) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type Frontier ¶
type Frontier struct { HeaderBlock Hash `msg:"headerblock,extension" json:"headerblock"` OpenBlock Hash `msg:"openblock,extension" json:"openblock"` }
func (*Frontier) Deserialize ¶ added in v1.3.0
func (Frontier) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type FrontierBlock ¶ added in v1.3.0
type FrontierBlock struct { Fr *Frontier HeaderBlk *StateBlock }
func (*FrontierBlock) DecodeMsg ¶ added in v1.3.0
func (z *FrontierBlock) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*FrontierBlock) Deserialize ¶ added in v1.3.0
func (fb *FrontierBlock) Deserialize(text []byte) error
func (*FrontierBlock) EncodeMsg ¶ added in v1.3.0
func (z *FrontierBlock) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*FrontierBlock) MarshalMsg ¶ added in v1.3.0
func (z *FrontierBlock) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*FrontierBlock) Msgsize ¶ added in v1.3.0
func (z *FrontierBlock) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*FrontierBlock) Serialize ¶ added in v1.3.0
func (fb *FrontierBlock) Serialize() ([]byte, error)
func (*FrontierBlock) UnmarshalMsg ¶ added in v1.3.0
func (z *FrontierBlock) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type Frontiers ¶
type Frontiers []*Frontier
func (Frontiers) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type GapDoDSettleStateBlockWalkFunc ¶ added in v1.4.0
type GapDoDSettleStateBlockWalkFunc func(block *StateBlock, sync SynchronizedKind) error
type GapPovBlockWalkFunc ¶ added in v1.3.0
type GapPovBlockWalkFunc func(block *StateBlock, height uint64, sync SynchronizedKind) error
type GapPublishBlockWalkFunc ¶ added in v1.4.0
type GapPublishBlockWalkFunc func(block *StateBlock, sync SynchronizedKind) error
type GenericKey ¶ added in v1.3.0
type GenericKey struct {
Key string
}
func (*GenericKey) Deserialize ¶ added in v1.3.0
func (k *GenericKey) Deserialize(text []byte) error
func (*GenericKey) Serialize ¶ added in v1.3.0
func (k *GenericKey) Serialize() ([]byte, error)
type GenericKeyC ¶ added in v1.4.0
type GenericKeyC struct {
Key string
}
func (*GenericKeyC) Deserialize ¶ added in v1.4.0
func (k *GenericKeyC) Deserialize(text []byte) error
func (*GenericKeyC) Serialize ¶ added in v1.4.0
func (k *GenericKeyC) Serialize() ([]byte, error)
type GenericType ¶ added in v1.3.0
type GenericType struct {
Value string
}
func (*GenericType) Deserialize ¶ added in v1.3.0
func (t *GenericType) Deserialize(text []byte) error
func (*GenericType) Serialize ¶ added in v1.3.0
func (t *GenericType) Serialize() ([]byte, error)
type GenericTypeC ¶ added in v1.4.0
type GenericTypeC struct {
Value string
}
func (*GenericTypeC) Deserialize ¶ added in v1.4.0
func (t *GenericTypeC) Deserialize(text []byte) error
func (*GenericTypeC) Serialize ¶ added in v1.4.0
func (t *GenericTypeC) Serialize() ([]byte, error)
type GenesisTokenInfo ¶ added in v1.1.0
type GenesisTokenInfo struct { TokenId Hash `json:"tokenId"` TokenName string `json:"tokenName"` TokenSymbol string `json:"tokenSymbol"` TotalSupply *big.Int `json:"totalSupply"` Decimals uint8 `json:"decimals"` Owner Address `json:"owner"` PledgeAmount *big.Int `json:"pledgeAmount"` WithdrawTime int64 `json:"withdrawTime"` PledgeAddress Address `json:"pledgeAddress"` }
type Hash ¶
Hash blake2b hash
func BytesToHash ¶ added in v0.0.9
func HybridHashData ¶ added in v1.4.0
func ScryptHashBytes ¶ added in v1.3.0
func ScryptHashData ¶ added in v1.3.0
func Sha256DHashBytes ¶ added in v1.3.0
Sha256DHashBytes hash data by sha256
func Sha256DHashData ¶ added in v1.3.0
func Sha256HashData ¶ added in v1.4.0
func X11HashData ¶ added in v1.3.0
func (*Hash) Deserialize ¶ added in v1.4.0
func (*Hash) ExtensionType ¶
ExtensionType implements Extension.ExtensionType interface
func (Hash) MarshalBinaryTo ¶
ExtensionType implements Extension.MarshalBinaryTo interface
func (*Hash) MarshalMsg ¶ added in v1.1.0
MarshalMsg implements msgp.Marshaler
func (Hash) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*Hash) Msgsize ¶ added in v1.1.0
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (Hash) ReverseByte ¶ added in v1.3.0
func (Hash) ReverseEndian ¶ added in v1.3.0
func (*Hash) UnmarshalBinary ¶
ExtensionType implements Extension.UnmarshalBinary interface
func (*Hash) UnmarshalMsg ¶ added in v1.1.0
UnmarshalMsg implements msgp.Unmarshaler
func (*Hash) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler
type HexBytes ¶ added in v1.3.0
type HexBytes []byte
func NewHexBytesFromData ¶ added in v1.3.0
func NewHexBytesFromHex ¶ added in v1.3.0
func (HexBytes) ExtensionType ¶ added in v1.3.0
ExtensionType implements Extension.ExtensionType interface
func (HexBytes) MarshalBinaryTo ¶ added in v1.3.0
ExtensionType implements Extension.MarshalBinaryTo interface
func (HexBytes) MarshalMsg ¶ added in v1.4.0
MarshalMsg implements msgp.Marshaler
func (HexBytes) MarshalText ¶ added in v1.3.0
MarshalText implements the encoding.TextMarshaler interface.
func (HexBytes) Msgsize ¶ added in v1.4.0
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*HexBytes) UnmarshalBinary ¶ added in v1.3.0
ExtensionType implements Extension.UnmarshalBinary interface
func (*HexBytes) UnmarshalMsg ¶ added in v1.4.0
UnmarshalMsg implements msgp.Unmarshaler
func (*HexBytes) UnmarshalText ¶ added in v1.3.0
UnmarshalText implements encoding.TextUnmarshaler
type PeerInfo ¶ added in v1.3.1
type PeerInfo struct { PeerID string `json:"peerid"` Address string `json:"address"` Version string `json:"version"` Rtt float64 `json:"rtt"` LastUpdateTime string `json:"lastUpdateTime"` }
func (*PeerInfo) Deserialize ¶ added in v1.3.1
func (*PeerInfo) MarshalMsg ¶ added in v1.3.1
MarshalMsg implements msgp.Marshaler
type PendingInfo ¶
type PendingInfo struct { Source Address `msg:"source,extension" json:"source"` Amount Balance `msg:"amount,extension" json:"amount"` Type Hash `msg:"type,extension" json:"type"` }
func (*PendingInfo) DecodeMsg ¶
func (z *PendingInfo) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*PendingInfo) Deserialize ¶ added in v1.3.0
func (pi *PendingInfo) Deserialize(text []byte) error
func (PendingInfo) EncodeMsg ¶
func (z PendingInfo) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (PendingInfo) MarshalMsg ¶
func (z PendingInfo) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (PendingInfo) Msgsize ¶
func (z PendingInfo) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*PendingInfo) Serialize ¶ added in v1.3.0
func (pi *PendingInfo) Serialize() ([]byte, error)
func (*PendingInfo) UnmarshalMsg ¶
func (z *PendingInfo) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type PendingKey ¶
type PendingKey struct { Address Address `msg:"account,extension" json:"account"` Hash Hash `msg:"hash,extension" json:"hash"` }
func (*PendingKey) DecodeMsg ¶
func (z *PendingKey) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*PendingKey) Deserialize ¶ added in v1.3.0
func (pk *PendingKey) Deserialize(text []byte) error
func (PendingKey) EncodeMsg ¶
func (z PendingKey) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (PendingKey) MarshalMsg ¶
func (z PendingKey) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (PendingKey) Msgsize ¶
func (z PendingKey) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*PendingKey) Serialize ¶ added in v1.3.0
func (pk *PendingKey) Serialize() ([]byte, error)
func (*PendingKey) UnmarshalMsg ¶
func (z *PendingKey) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type PendingKind ¶ added in v1.2.7
type PendingKind byte
const ( PendingNotUsed PendingKind = iota PendingUsed )
func (*PendingKind) DecodeMsg ¶ added in v1.4.0
func (z *PendingKind) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (PendingKind) EncodeMsg ¶ added in v1.4.0
func (z PendingKind) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (PendingKind) MarshalMsg ¶ added in v1.4.0
func (z PendingKind) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (PendingKind) Msgsize ¶ added in v1.4.0
func (z PendingKind) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*PendingKind) UnmarshalMsg ¶ added in v1.4.0
func (z *PendingKind) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type PovAccountState ¶ added in v1.2.3
type PovAccountState struct { Account Address `msg:"a,extension" json:"account"` Balance Balance `msg:"b,extension" json:"balance"` Vote Balance `msg:"v,extension" json:"vote"` Network Balance `msg:"n,extension" json:"network"` Storage Balance `msg:"s,extension" json:"storage"` Oracle Balance `msg:"o,extension" json:"oracle"` TokenStates []*PovTokenState `msg:"ts" json:"tokenStates"` }
func NewPovAccountState ¶ added in v1.2.3
func NewPovAccountState() *PovAccountState
func (*PovAccountState) Clone ¶ added in v1.2.3
func (as *PovAccountState) Clone() *PovAccountState
func (*PovAccountState) DecodeMsg ¶ added in v1.2.3
func (z *PovAccountState) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*PovAccountState) Deserialize ¶ added in v1.2.3
func (as *PovAccountState) Deserialize(text []byte) error
func (*PovAccountState) EncodeMsg ¶ added in v1.2.3
func (z *PovAccountState) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*PovAccountState) GetTokenState ¶ added in v1.2.3
func (as *PovAccountState) GetTokenState(tokenType Hash) *PovTokenState
func (*PovAccountState) MarshalMsg ¶ added in v1.2.3
func (z *PovAccountState) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*PovAccountState) Msgsize ¶ added in v1.2.3
func (z *PovAccountState) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*PovAccountState) Serialize ¶ added in v1.2.3
func (as *PovAccountState) Serialize() ([]byte, error)
func (*PovAccountState) String ¶ added in v1.2.3
func (as *PovAccountState) String() string
func (*PovAccountState) TotalBalance ¶ added in v1.2.3
func (as *PovAccountState) TotalBalance() Balance
func (*PovAccountState) UnmarshalMsg ¶ added in v1.2.3
func (z *PovAccountState) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type PovAlgoType ¶ added in v1.3.0
type PovAlgoType uint32
func NewPoVHashAlgoFromStr ¶ added in v1.3.0
func NewPoVHashAlgoFromStr(name string) PovAlgoType
func (PovAlgoType) String ¶ added in v1.3.0
func (a PovAlgoType) String() string
type PovAuxHeader ¶ added in v1.3.0
type PovAuxHeader struct { AuxMerkleBranch []*Hash `msg:"amb" json:"auxMerkleBranch"` AuxMerkleIndex int `msg:"ami" json:"auxMerkleIndex"` ParCoinBaseTx PovBtcTx `msg:"pcbtx" json:"parCoinBaseTx"` ParCoinBaseMerkle []*Hash `msg:"pcbm,extension" json:"parCoinBaseMerkle"` ParMerkleIndex int `msg:"pmi" json:"parMerkleIndex"` ParBlockHeader PovBtcHeader `msg:"pbh" json:"parBlockHeader"` ParentHash Hash `msg:"ph,extension" json:"parentHash"` }
func NewPovAuxHeader ¶ added in v1.3.0
func NewPovAuxHeader() *PovAuxHeader
func (*PovAuxHeader) ComputePowHash ¶ added in v1.3.0
func (ah *PovAuxHeader) ComputePowHash(algo PovAlgoType) Hash
func (*PovAuxHeader) DecodeMsg ¶ added in v1.3.0
func (z *PovAuxHeader) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*PovAuxHeader) Deserialize ¶ added in v1.3.0
func (ah *PovAuxHeader) Deserialize(text []byte) error
func (*PovAuxHeader) EncodeMsg ¶ added in v1.3.0
func (z *PovAuxHeader) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*PovAuxHeader) MarshalMsg ¶ added in v1.3.0
func (z *PovAuxHeader) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*PovAuxHeader) Msgsize ¶ added in v1.3.0
func (z *PovAuxHeader) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*PovAuxHeader) Serialize ¶ added in v1.3.0
func (ah *PovAuxHeader) Serialize() ([]byte, error)
func (*PovAuxHeader) UnmarshalMsg ¶ added in v1.3.0
func (z *PovAuxHeader) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type PovBaseHeader ¶ added in v1.3.0
type PovBaseHeader struct { Version uint32 `msg:"v" json:"version"` Previous Hash `msg:"p,extension" json:"previous"` MerkleRoot Hash `msg:"mr,extension" json:"merkleRoot"` Timestamp uint32 `msg:"ts" json:"timestamp"` Bits uint32 `msg:"b" json:"bits"` // algo bits Nonce uint32 `msg:"n" json:"nonce"` // just for internal use Hash Hash `msg:"ha,extension" json:"hash"` Height uint64 `msg:"he" json:"height"` // just for cache use NormBits uint32 `msg:"-" json:"-"` // normalized bits NormTargetInt *big.Int `msg:"-" json:"-"` // normalized target big int AlgoTargetInt *big.Int `msg:"-" json:"-"` // }
func (*PovBaseHeader) DecodeMsg ¶ added in v1.3.0
func (z *PovBaseHeader) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*PovBaseHeader) Deserialize ¶ added in v1.3.0
func (bh *PovBaseHeader) Deserialize(text []byte) error
func (*PovBaseHeader) EncodeMsg ¶ added in v1.3.0
func (z *PovBaseHeader) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*PovBaseHeader) MarshalMsg ¶ added in v1.3.0
func (z *PovBaseHeader) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*PovBaseHeader) Msgsize ¶ added in v1.3.0
func (z *PovBaseHeader) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*PovBaseHeader) Serialize ¶ added in v1.3.0
func (bh *PovBaseHeader) Serialize() ([]byte, error)
func (*PovBaseHeader) UnmarshalMsg ¶ added in v1.3.0
func (z *PovBaseHeader) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type PovBlock ¶ added in v1.2.3
type PovBlock struct { Header PovHeader `msg:"h" json:"header"` Body PovBody `msg:"b" json:"body"` }
func NewPovBlock ¶ added in v1.3.0
func NewPovBlock() *PovBlock
func NewPovBlockWithBody ¶ added in v1.2.3
func (*PovBlock) ComputeHash ¶ added in v1.2.3
func (*PovBlock) Deserialize ¶ added in v1.2.3
func (*PovBlock) GetAccountTxs ¶ added in v1.3.0
func (blk *PovBlock) GetAccountTxs() []*PovTransaction
func (*PovBlock) GetAlgoEfficiency ¶ added in v1.3.0
func (*PovBlock) GetAlgoType ¶ added in v1.3.0
func (blk *PovBlock) GetAlgoType() PovAlgoType
func (*PovBlock) GetAllTxs ¶ added in v1.3.0
func (blk *PovBlock) GetAllTxs() []*PovTransaction
func (*PovBlock) GetCoinBaseTx ¶ added in v1.3.0
func (blk *PovBlock) GetCoinBaseTx() *PovTransaction
func (*PovBlock) GetMerkleRoot ¶ added in v1.2.3
func (*PovBlock) GetMinerAddr ¶ added in v1.3.0
func (*PovBlock) GetPrevious ¶ added in v1.2.3
func (*PovBlock) GetStateHash ¶ added in v1.2.3
func (*PovBlock) GetTimestamp ¶ added in v1.2.3
func (*PovBlock) GetTxByIndex ¶ added in v1.3.0
func (blk *PovBlock) GetTxByIndex(index int) *PovTransaction
func (*PovBlock) GetVersion ¶ added in v1.3.0
func (*PovBlock) MarshalMsg ¶ added in v1.2.3
MarshalMsg implements msgp.Marshaler
type PovBlockFrom ¶ added in v1.2.3
type PovBlockFrom uint16
const ( PovBlockFromUnkonwn PovBlockFrom = iota PovBlockFromLocal PovBlockFromRemoteBroadcast PovBlockFromRemoteFetch PovBlockFromRemoteSync )
func (*PovBlockFrom) DecodeMsg ¶ added in v1.2.3
func (z *PovBlockFrom) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (PovBlockFrom) EncodeMsg ¶ added in v1.2.3
func (z PovBlockFrom) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (PovBlockFrom) MarshalMsg ¶ added in v1.2.3
func (z PovBlockFrom) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (PovBlockFrom) Msgsize ¶ added in v1.2.3
func (z PovBlockFrom) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*PovBlockFrom) UnmarshalMsg ¶ added in v1.2.3
func (z *PovBlockFrom) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type PovBlocks ¶ added in v1.2.3
type PovBlocks []*PovBlock
func (*PovBlocks) Deserialize ¶ added in v1.2.3
func (PovBlocks) MarshalMsg ¶ added in v1.2.3
MarshalMsg implements msgp.Marshaler
type PovBody ¶ added in v1.2.3
type PovBody struct {
Txs []*PovTransaction `msg:"txs" json:"txs"`
}
func NewPovBody ¶ added in v1.3.0
func NewPovBody() *PovBody
func (*PovBody) Deserialize ¶ added in v1.2.3
func (*PovBody) MarshalMsg ¶ added in v1.2.3
MarshalMsg implements msgp.Marshaler
type PovBtcHeader ¶ added in v1.3.0
type PovBtcHeader struct { Version uint32 `msg:"v" json:"version"` Previous Hash `msg:"p,extension" json:"previous"` MerkleRoot Hash `msg:"mr,extension" json:"merkleRoot"` Timestamp uint32 `msg:"ts" json:"timestamp"` Bits uint32 `msg:"b" json:"bits"` Nonce uint32 `msg:"n" json:"nonce"` }
func (*PovBtcHeader) BuildHashData ¶ added in v1.3.0
func (h *PovBtcHeader) BuildHashData() []byte
func (*PovBtcHeader) ComputeHash ¶ added in v1.3.0
func (h *PovBtcHeader) ComputeHash() Hash
func (*PovBtcHeader) ComputePowHash ¶ added in v1.3.0
func (h *PovBtcHeader) ComputePowHash(algo PovAlgoType) Hash
func (*PovBtcHeader) DecodeMsg ¶ added in v1.3.0
func (z *PovBtcHeader) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*PovBtcHeader) Deserialize ¶ added in v1.3.0
func (h *PovBtcHeader) Deserialize(text []byte) error
func (*PovBtcHeader) EncodeMsg ¶ added in v1.3.0
func (z *PovBtcHeader) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*PovBtcHeader) MarshalMsg ¶ added in v1.3.0
func (z *PovBtcHeader) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*PovBtcHeader) Msgsize ¶ added in v1.3.0
func (z *PovBtcHeader) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*PovBtcHeader) Serialize ¶ added in v1.3.0
func (h *PovBtcHeader) Serialize() ([]byte, error)
func (*PovBtcHeader) UnmarshalMsg ¶ added in v1.3.0
func (z *PovBtcHeader) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type PovBtcOutPoint ¶ added in v1.3.0
type PovBtcOutPoint struct { Hash Hash `msg:"h,extension" json:"hash"` Index uint32 `msg:"i" json:"index"` }
func (*PovBtcOutPoint) DecodeMsg ¶ added in v1.3.0
func (z *PovBtcOutPoint) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*PovBtcOutPoint) Deserialize ¶ added in v1.3.0
func (p *PovBtcOutPoint) Deserialize(text []byte) error
func (PovBtcOutPoint) EncodeMsg ¶ added in v1.3.0
func (z PovBtcOutPoint) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (PovBtcOutPoint) MarshalMsg ¶ added in v1.3.0
func (z PovBtcOutPoint) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (PovBtcOutPoint) Msgsize ¶ added in v1.3.0
func (z PovBtcOutPoint) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*PovBtcOutPoint) Serialize ¶ added in v1.3.0
func (p *PovBtcOutPoint) Serialize() ([]byte, error)
func (*PovBtcOutPoint) UnmarshalMsg ¶ added in v1.3.0
func (z *PovBtcOutPoint) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type PovBtcTx ¶ added in v1.3.0
type PovBtcTx struct { Version int32 `msg:"v" json:"version"` TxIn []*PovBtcTxIn `msg:"ti" json:"txIn"` TxOut []*PovBtcTxOut `msg:"to" json:"txOut"` LockTime uint32 `msg:"lt" json:"lockTime"` }
func NewPovBtcTx ¶ added in v1.3.0
func NewPovBtcTx(txIn []*PovBtcTxIn, txOut []*PovBtcTxOut) *PovBtcTx
func (*PovBtcTx) BuildHashData ¶ added in v1.3.0
func (*PovBtcTx) ComputeHash ¶ added in v1.3.0
func (*PovBtcTx) Deserialize ¶ added in v1.3.0
func (*PovBtcTx) MarshalMsg ¶ added in v1.3.0
MarshalMsg implements msgp.Marshaler
type PovBtcTxIn ¶ added in v1.3.0
type PovBtcTxIn struct { PreviousOutPoint PovBtcOutPoint `msg:"pop" json:"previousOutPoint"` SignatureScript []byte `msg:"ss" json:"signatureScript"` Sequence uint32 `msg:"s" json:"sequence"` }
func (*PovBtcTxIn) BuildHashData ¶ added in v1.3.0
func (ti *PovBtcTxIn) BuildHashData() []byte
func (*PovBtcTxIn) DecodeMsg ¶ added in v1.3.0
func (z *PovBtcTxIn) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*PovBtcTxIn) Deserialize ¶ added in v1.3.0
func (ti *PovBtcTxIn) Deserialize(text []byte) error
func (*PovBtcTxIn) EncodeMsg ¶ added in v1.3.0
func (z *PovBtcTxIn) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*PovBtcTxIn) MarshalMsg ¶ added in v1.3.0
func (z *PovBtcTxIn) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*PovBtcTxIn) Msgsize ¶ added in v1.3.0
func (z *PovBtcTxIn) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*PovBtcTxIn) Serialize ¶ added in v1.3.0
func (ti *PovBtcTxIn) Serialize() ([]byte, error)
func (*PovBtcTxIn) UnmarshalMsg ¶ added in v1.3.0
func (z *PovBtcTxIn) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type PovBtcTxOut ¶ added in v1.3.0
type PovBtcTxOut struct { Value int64 `msg:"v" json:"value"` PkScript []byte `msg:"pks" json:"pkScript"` }
func (*PovBtcTxOut) BuildHashData ¶ added in v1.3.0
func (to *PovBtcTxOut) BuildHashData() []byte
func (*PovBtcTxOut) DecodeMsg ¶ added in v1.3.0
func (z *PovBtcTxOut) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*PovBtcTxOut) Deserialize ¶ added in v1.3.0
func (to *PovBtcTxOut) Deserialize(text []byte) error
func (*PovBtcTxOut) EncodeMsg ¶ added in v1.3.0
func (z *PovBtcTxOut) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*PovBtcTxOut) MarshalMsg ¶ added in v1.3.0
func (z *PovBtcTxOut) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*PovBtcTxOut) Msgsize ¶ added in v1.3.0
func (z *PovBtcTxOut) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*PovBtcTxOut) Serialize ¶ added in v1.3.0
func (to *PovBtcTxOut) Serialize() ([]byte, error)
func (*PovBtcTxOut) UnmarshalMsg ¶ added in v1.3.0
func (z *PovBtcTxOut) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type PovCoinBaseTx ¶ added in v1.3.0
type PovCoinBaseTx struct { Version uint32 `msg:"v" json:"version"` // TxIn like BTC's PreviousOutPoint TxIns []*PovCoinBaseTxIn `msg:"tis" json:"txIns"` // TxOut like BTC TxOuts []*PovCoinBaseTxOut `msg:"tos" json:"txOuts"` StateHash Hash `msg:"sh,extension" json:"stateHash"` TxNum uint32 `msg:"tn" json:"txNum"` // just for internal use Hash Hash `msg:"h,extension" json:"hash"` }
func NewPovCoinBaseTx ¶ added in v1.3.0
func NewPovCoinBaseTx(txInNum int, txOutNum int) *PovCoinBaseTx
func (*PovCoinBaseTx) BuildHashData ¶ added in v1.3.0
func (cbtx *PovCoinBaseTx) BuildHashData() []byte
func (*PovCoinBaseTx) ComputeHash ¶ added in v1.3.0
func (cbtx *PovCoinBaseTx) ComputeHash() Hash
func (*PovCoinBaseTx) Copy ¶ added in v1.3.0
func (cbtx *PovCoinBaseTx) Copy() *PovCoinBaseTx
func (*PovCoinBaseTx) DecodeMsg ¶ added in v1.3.0
func (z *PovCoinBaseTx) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*PovCoinBaseTx) Deserialize ¶ added in v1.3.0
func (cbtx *PovCoinBaseTx) Deserialize(text []byte) error
func (*PovCoinBaseTx) EncodeMsg ¶ added in v1.3.0
func (z *PovCoinBaseTx) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*PovCoinBaseTx) GetCoinBaseData1 ¶ added in v1.3.0
func (cbtx *PovCoinBaseTx) GetCoinBaseData1() []byte
func (*PovCoinBaseTx) GetCoinBaseData2 ¶ added in v1.3.0
func (cbtx *PovCoinBaseTx) GetCoinBaseData2() []byte
func (*PovCoinBaseTx) GetHash ¶ added in v1.3.0
func (cbtx *PovCoinBaseTx) GetHash() Hash
func (*PovCoinBaseTx) GetMinerTxOut ¶ added in v1.3.0
func (cbtx *PovCoinBaseTx) GetMinerTxOut() *PovCoinBaseTxOut
func (*PovCoinBaseTx) GetRepTxOut ¶ added in v1.3.0
func (cbtx *PovCoinBaseTx) GetRepTxOut() *PovCoinBaseTxOut
func (*PovCoinBaseTx) MarshalMsg ¶ added in v1.3.0
func (z *PovCoinBaseTx) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*PovCoinBaseTx) Msgsize ¶ added in v1.3.0
func (z *PovCoinBaseTx) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*PovCoinBaseTx) Serialize ¶ added in v1.3.0
func (cbtx *PovCoinBaseTx) Serialize() ([]byte, error)
func (*PovCoinBaseTx) UnmarshalMsg ¶ added in v1.3.0
func (z *PovCoinBaseTx) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type PovCoinBaseTxIn ¶ added in v1.3.0
type PovCoinBaseTxIn struct { PrevTxHash Hash `msg:"pth,extension" json:"prevTxHash"` PrevTxIdx uint32 `msg:"pti" json:"prevTxIdx"` Extra HexBytes `msg:"ext,extension" json:"extra"` // like BTC's script, filled by miner, 0 ~ 100 Sequence uint32 `msg:"seq" json:"sequence"` }
func (*PovCoinBaseTxIn) Copy ¶ added in v1.3.0
func (ti *PovCoinBaseTxIn) Copy() *PovCoinBaseTxIn
func (*PovCoinBaseTxIn) DecodeMsg ¶ added in v1.3.0
func (z *PovCoinBaseTxIn) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*PovCoinBaseTxIn) Deserialize ¶ added in v1.3.0
func (ti *PovCoinBaseTxIn) Deserialize(text []byte) error
func (*PovCoinBaseTxIn) EncodeMsg ¶ added in v1.3.0
func (z *PovCoinBaseTxIn) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*PovCoinBaseTxIn) MarshalMsg ¶ added in v1.3.0
func (z *PovCoinBaseTxIn) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*PovCoinBaseTxIn) Msgsize ¶ added in v1.3.0
func (z *PovCoinBaseTxIn) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*PovCoinBaseTxIn) Serialize ¶ added in v1.3.0
func (ti *PovCoinBaseTxIn) Serialize() ([]byte, error)
func (*PovCoinBaseTxIn) UnmarshalMsg ¶ added in v1.3.0
func (z *PovCoinBaseTxIn) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type PovCoinBaseTxOut ¶ added in v1.3.0
type PovCoinBaseTxOut struct { Value Balance `msg:"v,extension" json:"value"` Address Address `msg:"a,extension" json:"address"` }
func (*PovCoinBaseTxOut) Copy ¶ added in v1.3.0
func (to *PovCoinBaseTxOut) Copy() *PovCoinBaseTxOut
func (*PovCoinBaseTxOut) DecodeMsg ¶ added in v1.3.0
func (z *PovCoinBaseTxOut) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*PovCoinBaseTxOut) Deserialize ¶ added in v1.3.0
func (to *PovCoinBaseTxOut) Deserialize(text []byte) error
func (PovCoinBaseTxOut) EncodeMsg ¶ added in v1.3.0
func (z PovCoinBaseTxOut) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (PovCoinBaseTxOut) MarshalMsg ¶ added in v1.3.0
func (z PovCoinBaseTxOut) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (PovCoinBaseTxOut) Msgsize ¶ added in v1.3.0
func (z PovCoinBaseTxOut) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*PovCoinBaseTxOut) Serialize ¶ added in v1.3.0
func (to *PovCoinBaseTxOut) Serialize() ([]byte, error)
func (*PovCoinBaseTxOut) UnmarshalMsg ¶ added in v1.3.0
func (z *PovCoinBaseTxOut) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type PovContractState ¶ added in v1.4.0
type PovContractState struct { StateHash Hash `msg:"sh,extension" json:"stateHash"` CodeHash Hash `msg:"ch,extension" json:"codeHash"` }
Common Contract State, key value in trie for each contract key = contract address
func NewPovContractState ¶ added in v1.4.0
func NewPovContractState() *PovContractState
func (*PovContractState) DecodeMsg ¶ added in v1.4.0
func (z *PovContractState) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*PovContractState) Deserialize ¶ added in v1.4.0
func (cs *PovContractState) Deserialize(text []byte) error
func (PovContractState) EncodeMsg ¶ added in v1.4.0
func (z PovContractState) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (PovContractState) MarshalMsg ¶ added in v1.4.0
func (z PovContractState) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (PovContractState) Msgsize ¶ added in v1.4.0
func (z PovContractState) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*PovContractState) Serialize ¶ added in v1.4.0
func (cs *PovContractState) Serialize() ([]byte, error)
func (*PovContractState) UnmarshalMsg ¶ added in v1.4.0
func (z *PovContractState) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type PovDiffDayStat ¶ added in v1.3.1
type PovDiffDayStat struct { DayIndex uint32 `msg:"di" json:"dayIndex"` AvgDiffRatio uint64 `msg:"avgdr" json:"avgDiffRatio"` MaxDiffRatio uint64 `msg:"maxdr" json:"maxDiffRatio"` MinDiffRatio uint64 `msg:"mindr" json:"minDiffRatio"` MaxBlockTime uint32 `msg:"maxbt" json:"maxBlockTime"` MinBlockTime uint32 `msg:"minbt" json:"minBlockTime"` }
func NewPovDiffDayStat ¶ added in v1.3.1
func NewPovDiffDayStat() *PovDiffDayStat
func (*PovDiffDayStat) DecodeMsg ¶ added in v1.3.1
func (z *PovDiffDayStat) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*PovDiffDayStat) Deserialize ¶ added in v1.3.1
func (ds *PovDiffDayStat) Deserialize(text []byte) error
func (*PovDiffDayStat) EncodeMsg ¶ added in v1.3.1
func (z *PovDiffDayStat) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*PovDiffDayStat) MarshalMsg ¶ added in v1.3.1
func (z *PovDiffDayStat) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*PovDiffDayStat) Msgsize ¶ added in v1.3.1
func (z *PovDiffDayStat) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*PovDiffDayStat) Serialize ¶ added in v1.3.1
func (ds *PovDiffDayStat) Serialize() ([]byte, error)
func (*PovDiffDayStat) UnmarshalMsg ¶ added in v1.3.1
func (z *PovDiffDayStat) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type PovHeader ¶ added in v1.2.3
type PovHeader struct { BasHdr PovBaseHeader `msg:"basHdr" json:"basHdr"` AuxHdr *PovAuxHeader `msg:"auxHdr" json:"auxHdr"` CbTx *PovCoinBaseTx `msg:"cbtx" json:"cbtx"` }
func NewPovHeader ¶ added in v1.3.0
func NewPovHeader() *PovHeader
func (*PovHeader) BuildHashData ¶ added in v1.3.0
func (*PovHeader) ComputeHash ¶ added in v1.2.3
func (*PovHeader) ComputePowHash ¶ added in v1.3.0
func (*PovHeader) Deserialize ¶ added in v1.2.3
func (*PovHeader) GetAlgoEfficiency ¶ added in v1.3.0
func (*PovHeader) GetAlgoTargetInt ¶ added in v1.3.0
func (*PovHeader) GetAlgoType ¶ added in v1.3.0
func (h *PovHeader) GetAlgoType() PovAlgoType
func (*PovHeader) GetMinerAddr ¶ added in v1.3.0
func (*PovHeader) GetMinerReward ¶ added in v1.3.0
func (*PovHeader) GetNormBits ¶ added in v1.3.0
func (*PovHeader) GetNormTargetInt ¶ added in v1.3.0
func (*PovHeader) GetPrevious ¶ added in v1.2.3
func (*PovHeader) GetRepAddr ¶ added in v1.3.0
func (*PovHeader) GetRepReward ¶ added in v1.3.0
func (*PovHeader) GetStateHash ¶ added in v1.2.3
func (*PovHeader) GetTimestamp ¶ added in v1.2.3
func (*PovHeader) GetVersion ¶ added in v1.3.0
func (*PovHeader) MarshalMsg ¶ added in v1.2.3
MarshalMsg implements msgp.Marshaler
type PovMineBlock ¶ added in v1.3.0
type PovMineBlock struct { Block *PovBlock Header *PovHeader Body *PovBody AllTxHashes []*Hash WorkHash Hash MinTime uint32 CoinbaseBranch []*Hash }
func NewPovMineBlock ¶ added in v1.3.0
func NewPovMineBlock() *PovMineBlock
type PovMineResult ¶ added in v1.3.0
type PovMineResult struct { WorkHash Hash BlockHash Hash MerkleRoot Hash Timestamp uint32 Nonce uint32 CoinbaseExtra []byte CoinbaseHash Hash AuxPow *PovAuxHeader }
func NewPovMineResult ¶ added in v1.3.0
func NewPovMineResult() *PovMineResult
type PovMineWork ¶ added in v1.3.0
type PovMineWork struct { WorkHash Hash `json:"workHash"` Version uint32 `json:"version"` Previous Hash `json:"previous"` Bits uint32 `json:"bits"` Height uint64 `json:"height"` MinTime uint32 `json:"minTime"` MerkleBranch []*Hash `json:"merkleBranch"` CoinBaseData []byte `json:"coinbaseData"` }
func NewPovMineWork ¶ added in v1.3.0
func NewPovMineWork() *PovMineWork
type PovMinerDayStat ¶ added in v1.2.3
type PovMinerDayStat struct { DayIndex uint32 `msg:"di" json:"dayIndex"` MinerNum uint32 `msg:"mn" json:"minerNum"` MinerStats map[string]*PovMinerStatItem `msg:"mss" json:"minerStats"` }
func NewPovMinerDayStat ¶ added in v1.2.3
func NewPovMinerDayStat() *PovMinerDayStat
func (*PovMinerDayStat) DecodeMsg ¶ added in v1.2.3
func (z *PovMinerDayStat) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*PovMinerDayStat) Deserialize ¶ added in v1.2.3
func (mds *PovMinerDayStat) Deserialize(text []byte) error
func (*PovMinerDayStat) EncodeMsg ¶ added in v1.2.3
func (z *PovMinerDayStat) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*PovMinerDayStat) MarshalMsg ¶ added in v1.2.3
func (z *PovMinerDayStat) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*PovMinerDayStat) Msgsize ¶ added in v1.2.3
func (z *PovMinerDayStat) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*PovMinerDayStat) Serialize ¶ added in v1.2.3
func (mds *PovMinerDayStat) Serialize() ([]byte, error)
func (*PovMinerDayStat) UnmarshalMsg ¶ added in v1.2.3
func (z *PovMinerDayStat) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type PovMinerStatItem ¶ added in v1.2.3
type PovMinerStatItem struct { FirstHeight uint64 `msg:"fh" json:"firstHeight"` LastHeight uint64 `msg:"lh" json:"lastHeight"` BlockNum uint32 `msg:"bn" json:"blockNum"` RewardAmount Balance `msg:"ra,extension" json:"rewardAmount"` RepBlockNum uint32 `msg:"rn" json:"repBlockNum"` RepReward Balance `msg:"rr,extension" json:"repReward"` IsMiner bool `msg:"im" json:"isMiner"` }
func NewPovMinerStatItem ¶ added in v1.3.0
func NewPovMinerStatItem() *PovMinerStatItem
func (*PovMinerStatItem) DecodeMsg ¶ added in v1.2.3
func (z *PovMinerStatItem) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*PovMinerStatItem) Deserialize ¶ added in v1.2.3
func (msi *PovMinerStatItem) Deserialize(text []byte) error
func (*PovMinerStatItem) EncodeMsg ¶ added in v1.2.3
func (z *PovMinerStatItem) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*PovMinerStatItem) MarshalMsg ¶ added in v1.2.3
func (z *PovMinerStatItem) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*PovMinerStatItem) Msgsize ¶ added in v1.2.3
func (z *PovMinerStatItem) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*PovMinerStatItem) Serialize ¶ added in v1.2.3
func (msi *PovMinerStatItem) Serialize() ([]byte, error)
func (*PovMinerStatItem) UnmarshalMsg ¶ added in v1.2.3
func (z *PovMinerStatItem) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type PovPublishState ¶ added in v1.4.0
type PovPublishState struct { OracleAccounts []Address `msg:"oas" json:"oracleAccounts"` PublishHeight uint64 `msg:"ph" json:"publishHeight"` VerifiedHeight uint64 `msg:"vh" json:"verifiedHeight"` VerifiedStatus int8 `msg:"vs" json:"verifiedStatus"` BonusFee *BigNum `msg:"bf,extension" json:"bonusFee"` }
key = type + id + pubkey + sendBlockHash
func NewPovPublishState ¶ added in v1.4.0
func NewPovPublishState() *PovPublishState
func (*PovPublishState) DecodeMsg ¶ added in v1.4.0
func (z *PovPublishState) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*PovPublishState) Deserialize ¶ added in v1.4.0
func (ps *PovPublishState) Deserialize(text []byte) error
func (*PovPublishState) EncodeMsg ¶ added in v1.4.0
func (z *PovPublishState) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*PovPublishState) MarshalMsg ¶ added in v1.4.0
func (z *PovPublishState) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*PovPublishState) Msgsize ¶ added in v1.4.0
func (z *PovPublishState) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*PovPublishState) Serialize ¶ added in v1.4.0
func (ps *PovPublishState) Serialize() ([]byte, error)
func (*PovPublishState) UnmarshalMsg ¶ added in v1.4.0
func (z *PovPublishState) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type PovRepState ¶ added in v1.2.3
type PovRepState struct { Account Address `msg:"a,extension" json:"account"` Balance Balance `msg:"b,extension" json:"balance"` Vote Balance `msg:"v,extension" json:"vote"` Network Balance `msg:"n,extension" json:"network"` Storage Balance `msg:"s,extension" json:"storage"` Oracle Balance `msg:"o,extension" json:"oracle"` Total Balance `msg:"t,extension" json:"total"` Status uint32 `msg:"st" json:"status"` Height uint64 `msg:"he" json:"height"` }
func NewPovRepState ¶ added in v1.2.3
func NewPovRepState() *PovRepState
func (*PovRepState) CalcTotal ¶ added in v1.2.3
func (rs *PovRepState) CalcTotal() Balance
func (*PovRepState) Clone ¶ added in v1.2.3
func (rs *PovRepState) Clone() *PovRepState
func (*PovRepState) DecodeMsg ¶ added in v1.2.3
func (z *PovRepState) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*PovRepState) Deserialize ¶ added in v1.2.3
func (rs *PovRepState) Deserialize(text []byte) error
func (*PovRepState) EncodeMsg ¶ added in v1.2.3
func (z *PovRepState) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*PovRepState) MarshalMsg ¶ added in v1.2.3
func (z *PovRepState) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*PovRepState) Msgsize ¶ added in v1.2.3
func (z *PovRepState) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*PovRepState) Serialize ¶ added in v1.2.3
func (rs *PovRepState) Serialize() ([]byte, error)
func (*PovRepState) String ¶ added in v1.2.3
func (rs *PovRepState) String() string
func (*PovRepState) UnmarshalMsg ¶ added in v1.2.3
func (z *PovRepState) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type PovTD ¶ added in v1.3.0
type PovTD struct { Chain BigNum `msg:"c,extension" json:"chain"` Sha256d BigNum `msg:"sha,extension" json:"sha256d"` Scrypt BigNum `msg:"scr,extension" json:"scrypt"` X11 BigNum `msg:"x11,extension" json:"x11"` Hybrid BigNum `msg:"hybrid,extension" json:"hybrid"` }
func (*PovTD) Deserialize ¶ added in v1.3.0
func (*PovTD) MarshalMsg ¶ added in v1.3.0
MarshalMsg implements msgp.Marshaler
type PovTokenState ¶ added in v1.2.3
type PovTokenState struct { Type Hash `msg:"t,extension" json:"type"` Hash Hash `msg:"h,extension" json:"hash"` Representative Address `msg:"r,extension" json:"representative"` Balance Balance `msg:"b,extension" json:"balance"` }
func NewPovTokenState ¶ added in v1.2.3
func NewPovTokenState(token Hash) *PovTokenState
func (*PovTokenState) Clone ¶ added in v1.2.3
func (ts *PovTokenState) Clone() *PovTokenState
func (*PovTokenState) DecodeMsg ¶ added in v1.2.3
func (z *PovTokenState) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*PovTokenState) Deserialize ¶ added in v1.2.3
func (ts *PovTokenState) Deserialize(text []byte) error
func (*PovTokenState) EncodeMsg ¶ added in v1.2.3
func (z *PovTokenState) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*PovTokenState) MarshalMsg ¶ added in v1.2.3
func (z *PovTokenState) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*PovTokenState) Msgsize ¶ added in v1.2.3
func (z *PovTokenState) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*PovTokenState) Serialize ¶ added in v1.2.3
func (ts *PovTokenState) Serialize() ([]byte, error)
func (*PovTokenState) String ¶ added in v1.2.3
func (ts *PovTokenState) String() string
func (*PovTokenState) UnmarshalMsg ¶ added in v1.2.3
func (z *PovTokenState) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type PovTransaction ¶ added in v1.2.3
type PovTransaction struct { Hash Hash `msg:"h,extension" json:"hash"` CbTx *PovCoinBaseTx `msg:"-" json:"-"` Block *StateBlock `msg:"-" json:"-"` }
PovTransaction represents an state block metadata in the PoV block.
func (*PovTransaction) Copy ¶ added in v1.3.0
func (tx *PovTransaction) Copy() *PovTransaction
func (*PovTransaction) DecodeMsg ¶ added in v1.2.3
func (z *PovTransaction) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*PovTransaction) Deserialize ¶ added in v1.2.3
func (tx *PovTransaction) Deserialize(text []byte) error
func (PovTransaction) EncodeMsg ¶ added in v1.2.3
func (z PovTransaction) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*PovTransaction) GetHash ¶ added in v1.2.3
func (tx *PovTransaction) GetHash() Hash
func (*PovTransaction) IsCbTx ¶ added in v1.3.0
func (tx *PovTransaction) IsCbTx() bool
func (PovTransaction) MarshalMsg ¶ added in v1.2.3
func (z PovTransaction) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (PovTransaction) Msgsize ¶ added in v1.2.3
func (z PovTransaction) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*PovTransaction) Serialize ¶ added in v1.2.3
func (tx *PovTransaction) Serialize() ([]byte, error)
func (*PovTransaction) UnmarshalMsg ¶ added in v1.2.3
func (z *PovTransaction) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type PovTransactions ¶ added in v1.2.3
type PovTransactions []*PovTransaction
PovTransactions is a PovTransaction slice type for basic sorting.
func (PovTransactions) Len ¶ added in v1.2.3
func (s PovTransactions) Len() int
Len returns the length of s.
func (PovTransactions) Swap ¶ added in v1.2.3
func (s PovTransactions) Swap(i, j int)
Swap swaps the i'th and the j'th element in s.
type PovTxByHash ¶ added in v1.2.3
type PovTxByHash PovTransactions
PovTxByHash implements the sort interface to allow sorting a list of transactions by their hash.
func (PovTxByHash) Len ¶ added in v1.2.3
func (s PovTxByHash) Len() int
func (PovTxByHash) Less ¶ added in v1.2.3
func (s PovTxByHash) Less(i, j int) bool
func (PovTxByHash) Swap ¶ added in v1.2.3
func (s PovTxByHash) Swap(i, j int)
type PovTxLookup ¶ added in v1.2.3
type PovTxLookup struct { BlockHash Hash `msg:"bha,extension" json:"blockHash"` BlockHeight uint64 `msg:"bhe" json:"blockHeight"` TxIndex uint64 `msg:"ti" json:"txIndex"` }
TxLookupEntry is a positional metadata to help looking up the data content of a transaction given only its hash.
func (*PovTxLookup) DecodeMsg ¶ added in v1.2.3
func (z *PovTxLookup) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*PovTxLookup) Deserialize ¶ added in v1.2.3
func (txl *PovTxLookup) Deserialize(text []byte) error
func (PovTxLookup) EncodeMsg ¶ added in v1.2.3
func (z PovTxLookup) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (PovTxLookup) MarshalMsg ¶ added in v1.2.3
func (z PovTxLookup) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (PovTxLookup) Msgsize ¶ added in v1.2.3
func (z PovTxLookup) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*PovTxLookup) Serialize ¶ added in v1.2.3
func (txl *PovTxLookup) Serialize() ([]byte, error)
func (*PovTxLookup) UnmarshalMsg ¶ added in v1.2.3
func (z *PovTxLookup) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type PovVerifierState ¶ added in v1.4.0
type PovVerifierState struct { TotalVerify uint64 `msg:"tv" json:"totalVerify"` TotalReward *BigNum `msg:"tr,extension" json:"totalReward"` ActiveHeight map[string]uint64 `msg:"ah" json:"activeHeight"` }
key = address
func NewPovVerifierState ¶ added in v1.4.0
func NewPovVerifierState() *PovVerifierState
func (*PovVerifierState) DecodeMsg ¶ added in v1.4.0
func (z *PovVerifierState) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*PovVerifierState) Deserialize ¶ added in v1.4.0
func (vs *PovVerifierState) Deserialize(text []byte) error
func (*PovVerifierState) EncodeMsg ¶ added in v1.4.0
func (z *PovVerifierState) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*PovVerifierState) MarshalMsg ¶ added in v1.4.0
func (z *PovVerifierState) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*PovVerifierState) Msgsize ¶ added in v1.4.0
func (z *PovVerifierState) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*PovVerifierState) Serialize ¶ added in v1.4.0
func (vs *PovVerifierState) Serialize() ([]byte, error)
func (*PovVerifierState) UnmarshalMsg ¶ added in v1.4.0
func (z *PovVerifierState) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type Seed ¶
Seed of account
func BytesToSeed ¶
func (*Seed) ExtensionType ¶
ExtensionType implements Extension.ExtensionType interface
func (Seed) MarshalBinaryTo ¶
ExtensionType implements Extension.MarshalBinaryTo interface
func (Seed) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface
func (*Seed) MarshalMsg ¶ added in v1.4.0
MarshalMsg implements msgp.Marshaler
func (*Seed) MasterAddress ¶
MasterAddress the first address generate by seed
func (*Seed) Msgsize ¶ added in v1.4.0
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*Seed) UnmarshalBinary ¶
ExtensionType implements Extension.UnmarshalBinary interface
type Serializer ¶ added in v1.4.0
type Signature ¶
type Signature [SignatureSize]byte
Signature of block
func BytesToSignature ¶ added in v1.2.0
func NewSignature ¶ added in v1.2.3
func (*Signature) ExtensionType ¶
ExtensionType implements Extension.ExtensionType interface
func (*Signature) FromBigInt ¶ added in v1.2.3
FromBigInt converts a big.Int into a types.Signature.
func (Signature) MarshalBinaryTo ¶
ExtensionType implements Extension.MarshalBinaryTo interface
func (Signature) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*Signature) ToBigInt ¶ added in v1.2.3
ToBigInt converts a types.Signature into a big.Int that can be used to perform math comparisons.
func (*Signature) UnmarshalBinary ¶
ExtensionType implements Extension.UnmarshalBinary interface
func (*Signature) UnmarshalText ¶
type SmartContractBlock ¶
type SmartContractBlock struct { Address Address `msg:"address,extension" json:"address"` InternalAccount Address `msg:"internalAccount,extension" json:"internalAccount"` ExtraAddress []Address `msg:"extraAddress" json:"extraAddress,omitempty"` Owner Address `msg:"owner,extension" json:"owner"` Abi ContractAbi `msg:"contract,extension" json:"contract"` AbiSchema string `msg:"schema" json:"schema"` IsUseStorage bool `msg:"isUseStorage" json:"isUseStorage"` Work Work `msg:"work,extension" json:"work"` Signature Signature `msg:"signature,extension" json:"signature"` Version uint64 `msg:"version" json:"version"` }
func (*SmartContractBlock) DecodeMsg ¶
func (z *SmartContractBlock) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*SmartContractBlock) Deserialize ¶ added in v0.0.9
func (sc *SmartContractBlock) Deserialize(text []byte) error
func (*SmartContractBlock) EncodeMsg ¶
func (z *SmartContractBlock) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*SmartContractBlock) GetHash ¶
func (sc *SmartContractBlock) GetHash() Hash
func (*SmartContractBlock) MarshalMsg ¶
func (z *SmartContractBlock) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*SmartContractBlock) Msgsize ¶
func (z *SmartContractBlock) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*SmartContractBlock) Serialize ¶ added in v0.0.9
func (sc *SmartContractBlock) Serialize() ([]byte, error)
func (*SmartContractBlock) Size ¶
func (sc *SmartContractBlock) Size() int
func (*SmartContractBlock) String ¶ added in v0.0.9
func (sc *SmartContractBlock) String() string
func (*SmartContractBlock) UnmarshalMsg ¶
func (z *SmartContractBlock) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type StateBlock ¶
type StateBlock struct { Type BlockType `msg:"type" json:"type"` Token Hash `msg:"token,extension" json:"token"` Address Address `msg:"address,extension" json:"address"` Balance Balance `msg:"balance,extension" json:"balance"` Vote Balance `msg:"vote,extension" json:"vote"` Network Balance `msg:"network,extension" json:"network"` Storage Balance `msg:"storage,extension" json:"storage"` Oracle Balance `msg:"oracle,extension" json:"oracle"` Previous Hash `msg:"previous,extension" json:"previous"` Link Hash `msg:"link,extension" json:"link"` Sender []byte `msg:"sender" json:"sender,omitempty"` Receiver []byte `msg:"receiver" json:"receiver,omitempty"` Message Hash `msg:"message,extension" json:"message,omitempty"` Data []byte `msg:"data" json:"data,omitempty"` PoVHeight uint64 `msg:"povHeight" json:"povHeight"` Timestamp int64 `msg:"timestamp" json:"timestamp"` Extra Hash `msg:"extra,extension" json:"extra,omitempty"` Representative Address `msg:"representative,extension" json:"representative"` PrivateFrom string `msg:"priFrom,omitempty" json:"privateFrom,omitempty"` PrivateFor []string `msg:"priFor,omitempty" json:"privateFor,omitempty"` PrivateGroupID string `msg:"priGid,omitempty" json:"privateGroupID,omitempty"` Work Work `msg:"work,extension" json:"work"` Signature Signature `msg:"signature,extension" json:"signature"` // following fields just for cache, not marshaled in db or p2p message Flag uint64 `msg:"-" json:"-"` PrivateRecvRsp bool `msg:"-" json:"-"` PrivatePayload []byte `msg:"-" json:"-"` }
func (*StateBlock) BuildHashData ¶ added in v1.4.0
func (b *StateBlock) BuildHashData() []byte
func (*StateBlock) CheckPrivateRecvRsp ¶ added in v1.4.0
func (b *StateBlock) CheckPrivateRecvRsp() error
func (*StateBlock) Clone ¶ added in v0.0.9
func (b *StateBlock) Clone() *StateBlock
func (*StateBlock) ConvertToSchema ¶ added in v1.4.0
func (b *StateBlock) ConvertToSchema() ([]Schema, error)
func (*StateBlock) DecodeMsg ¶
func (z *StateBlock) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*StateBlock) Deserialize ¶ added in v0.0.9
func (b *StateBlock) Deserialize(text []byte) error
func (*StateBlock) EncodeMsg ¶
func (z *StateBlock) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*StateBlock) GetAddress ¶ added in v0.0.9
func (b *StateBlock) GetAddress() Address
func (*StateBlock) GetBalance ¶
func (b *StateBlock) GetBalance() Balance
func (*StateBlock) GetData ¶ added in v0.0.9
func (b *StateBlock) GetData() []byte
func (*StateBlock) GetExtra ¶ added in v0.0.9
func (b *StateBlock) GetExtra() Hash
func (*StateBlock) GetHash ¶
func (b *StateBlock) GetHash() Hash
func (*StateBlock) GetHashWithoutPrivacy ¶ added in v1.4.0
func (b *StateBlock) GetHashWithoutPrivacy() Hash
func (*StateBlock) GetLink ¶
func (b *StateBlock) GetLink() Hash
func (*StateBlock) GetMessage ¶ added in v0.0.9
func (b *StateBlock) GetMessage() Hash
func (*StateBlock) GetNetwork ¶ added in v1.1.0
func (b *StateBlock) GetNetwork() Balance
func (*StateBlock) GetOracle ¶ added in v1.1.0
func (b *StateBlock) GetOracle() Balance
func (*StateBlock) GetPayload ¶ added in v1.4.0
func (b *StateBlock) GetPayload() []byte
func (*StateBlock) GetPrevious ¶ added in v0.0.9
func (b *StateBlock) GetPrevious() Hash
func (*StateBlock) GetPrivatePayload ¶ added in v1.4.0
func (b *StateBlock) GetPrivatePayload() []byte
func (*StateBlock) GetReceiver ¶ added in v0.0.9
func (b *StateBlock) GetReceiver() []byte
func (*StateBlock) GetRepresentative ¶
func (b *StateBlock) GetRepresentative() Address
func (*StateBlock) GetSender ¶ added in v0.0.9
func (b *StateBlock) GetSender() []byte
func (*StateBlock) GetSignature ¶ added in v0.0.9
func (b *StateBlock) GetSignature() Signature
func (*StateBlock) GetStorage ¶ added in v1.1.0
func (b *StateBlock) GetStorage() Balance
func (*StateBlock) GetTimestamp ¶ added in v1.1.0
func (b *StateBlock) GetTimestamp() int64
func (*StateBlock) GetToken ¶
func (b *StateBlock) GetToken() Hash
func (*StateBlock) GetType ¶
func (b *StateBlock) GetType() BlockType
func (*StateBlock) GetVote ¶ added in v1.1.0
func (b *StateBlock) GetVote() Balance
func (*StateBlock) GetWork ¶ added in v0.0.9
func (b *StateBlock) GetWork() Work
func (*StateBlock) IsContractBlock ¶ added in v0.0.9
func (b *StateBlock) IsContractBlock() bool
func (*StateBlock) IsFromSync ¶ added in v1.4.0
func (b *StateBlock) IsFromSync() bool
func (*StateBlock) IsOpen ¶ added in v1.2.0
func (b *StateBlock) IsOpen() bool
func (*StateBlock) IsPrivate ¶ added in v1.4.0
func (b *StateBlock) IsPrivate() bool
func (*StateBlock) IsReceiveBlock ¶ added in v0.0.9
func (b *StateBlock) IsReceiveBlock() bool
func (*StateBlock) IsRecipient ¶ added in v1.4.0
func (b *StateBlock) IsRecipient() bool
func (*StateBlock) IsSendBlock ¶ added in v0.0.9
func (b *StateBlock) IsSendBlock() bool
func (*StateBlock) IsValid ¶
func (b *StateBlock) IsValid() bool
func (*StateBlock) MarshalMsg ¶
func (z *StateBlock) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*StateBlock) Msgsize ¶
func (z *StateBlock) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*StateBlock) Parent ¶ added in v1.0.1
func (b *StateBlock) Parent() Hash
func (*StateBlock) Root ¶
func (b *StateBlock) Root() Hash
func (*StateBlock) Serialize ¶ added in v0.0.9
func (b *StateBlock) Serialize() ([]byte, error)
func (*StateBlock) SetFromSync ¶ added in v1.4.0
func (b *StateBlock) SetFromSync()
func (*StateBlock) SetPrivatePayload ¶ added in v1.4.0
func (b *StateBlock) SetPrivatePayload(rawData []byte)
func (*StateBlock) Size ¶
func (b *StateBlock) Size() int
func (*StateBlock) String ¶ added in v0.0.9
func (b *StateBlock) String() string
func (*StateBlock) TotalBalance ¶ added in v1.1.0
func (b *StateBlock) TotalBalance() Balance
func (*StateBlock) UnmarshalMsg ¶
func (z *StateBlock) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type StateBlockList ¶ added in v1.2.3
type StateBlockList []*StateBlock
func (*StateBlockList) DecodeMsg ¶ added in v1.2.3
func (z *StateBlockList) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*StateBlockList) Deserialize ¶ added in v1.2.3
func (bs *StateBlockList) Deserialize(text []byte) error
func (StateBlockList) EncodeMsg ¶ added in v1.2.3
func (z StateBlockList) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (StateBlockList) MarshalMsg ¶ added in v1.2.3
func (z StateBlockList) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (StateBlockList) Msgsize ¶ added in v1.2.3
func (z StateBlockList) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*StateBlockList) Serialize ¶ added in v1.2.3
func (bs *StateBlockList) Serialize() ([]byte, error)
func (*StateBlockList) UnmarshalMsg ¶ added in v1.2.3
func (z *StateBlockList) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type SynchronizedKind ¶ added in v0.0.9
type SynchronizedKind byte
const ( Synchronized SynchronizedKind = iota UnSynchronized InvalidSynchronized )
func StringToSyncKind ¶ added in v1.3.0
func StringToSyncKind(str string) SynchronizedKind
func (*SynchronizedKind) DecodeMsg ¶ added in v0.0.9
func (z *SynchronizedKind) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (SynchronizedKind) EncodeMsg ¶ added in v0.0.9
func (z SynchronizedKind) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (SynchronizedKind) MarshalMsg ¶ added in v0.0.9
func (z SynchronizedKind) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (SynchronizedKind) Msgsize ¶ added in v0.0.9
func (z SynchronizedKind) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (SynchronizedKind) String ¶ added in v1.3.0
func (s SynchronizedKind) String() string
func (*SynchronizedKind) UnmarshalMsg ¶ added in v0.0.9
func (z *SynchronizedKind) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type TokenInfo ¶ added in v0.0.9
type TokenInfo struct { TokenId Hash `json:"tokenId"` TokenName string `json:"tokenName"` TokenSymbol string `json:"tokenSymbol"` TotalSupply *big.Int `json:"totalSupply"` Decimals uint8 `json:"decimals"` Owner Address `json:"owner"` PledgeAmount *big.Int `json:"pledgeAmount"` WithdrawTime int64 `json:"withdrawTime"` PledgeAddress Address `json:"pledgeAddress"` NEP5TxId string `json:"NEP5TxId"` }
type TokenMeta ¶
type TokenMeta struct { //TokenAccount Address `msg:"tokenAccount,extension" json:"token_account"` Type Hash `msg:"type,extension" json:"type"` Header Hash `msg:"header,extension" json:"header"` Representative Address `msg:"rep,extension" json:"representative"` OpenBlock Hash `msg:"open,extension" json:"open"` Balance Balance `msg:"balance,extension" json:"balance"` BelongTo Address `msg:"account,extension" json:"account"` Modified int64 `msg:"modified" json:"modified"` BlockCount int64 `msg:"blockCount," json:"blockCount"` }
func (*TokenMeta) Deserialize ¶ added in v1.4.0
func (*TokenMeta) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type TrieNode ¶ added in v1.1.0
type TrieNode struct { Hash *Hash `msg:"hash,extension" json:"hash"` Type byte `msg:"type" json:"type"` Children map[string][]byte `msg:"children" json:"children,omitempty"` Key []byte `msg:"key" json:"key,omitempty"` Child []byte `msg:"child" json:"child,omitempty"` Value []byte `msg:"value" json:"value,omitempty"` }
func (*TrieNode) MarshalMsg ¶ added in v1.1.0
MarshalMsg implements msgp.Marshaler
type Unchecked ¶ added in v1.4.0
type Unchecked struct { Block *StateBlock `msg:"block" json:"block"` Kind SynchronizedKind `msg:"kind" json:"kind"` }
func (*Unchecked) Deserialize ¶ added in v1.4.0
func (*Unchecked) MarshalMsg ¶ added in v1.4.0
MarshalMsg implements msgp.Marshaler
type UncheckedBlockWalkFunc ¶
type UncheckedBlockWalkFunc func(block *StateBlock, link Hash, unCheckType UncheckedKind, sync SynchronizedKind) error
type UncheckedKind ¶
type UncheckedKind byte
const ( UncheckedKindPrevious UncheckedKind = iota UncheckedKindLink UncheckedKindTokenInfo UncheckedKindPublish )
func (*UncheckedKind) DecodeMsg ¶
func (z *UncheckedKind) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (UncheckedKind) EncodeMsg ¶
func (z UncheckedKind) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (UncheckedKind) MarshalMsg ¶
func (z UncheckedKind) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (UncheckedKind) Msgsize ¶
func (z UncheckedKind) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*UncheckedKind) UnmarshalMsg ¶
func (z *UncheckedKind) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type VmLog ¶ added in v1.1.0
type VmLog struct { Topics []Hash `msg:"topics" json:"topics"` Data []byte `msg:"data" json:"data"` }
func (*VmLog) MarshalMsg ¶ added in v1.1.0
MarshalMsg implements msgp.Marshaler
type VmLogs ¶ added in v1.1.0
type VmLogs struct {
Logs []*VmLog `msg:"logs" json:"logs"`
}
func (*VmLogs) Deserialize ¶ added in v1.4.0
func (*VmLogs) MarshalMsg ¶ added in v1.1.0
MarshalMsg implements msgp.Marshaler
type Work ¶
type Work uint64
Work PoW work
func (*Work) ExtensionType ¶
ExtensionType implements Extension.ExtensionType interface
func (*Work) MarshalBinaryTo ¶
ExtensionType implements Extension.MarshalBinaryTo interface
func (Work) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*Work) ParseWorkHexString ¶
ParseWorkHexString create Work from hex string
func (*Work) UnmarshalBinary ¶
ExtensionType implements Extension.UnmarshalBinary interface
func (*Work) UnmarshalText ¶
Source Files ¶
- abi.go
- abi_gen.go
- account.go
- account_gen.go
- address.go
- address_gen.go
- address_token.go
- balance.go
- benefit.go
- benefit_gen.go
- bignum.go
- block.go
- block_contract.go
- block_contract_gen.go
- block_gen.go
- block_pov.go
- block_pov_btc.go
- block_pov_btc_gen.go
- block_pov_gen.go
- block_state.go
- block_state_gen.go
- extension.go
- frontier.go
- frontier_gen.go
- generic.go
- hash.go
- hash_gen.go
- hexbytes.go
- hexbytes_gen.go
- interface.go
- peersInfo.go
- peersInfo_gen.go
- pending.go
- pending_gen.go
- pov_algo.go
- pov_types.go
- seed.go
- seed_gen.go
- signature.go
- state_pov.go
- state_pov_gen.go
- target.go
- token.go
- trie_node.go
- trie_node_gen.go
- tuple.go
- unchecked.go
- unchecked_gen.go
- vmlog.go
- vmlog_gen.go
- work.go
- work_default.go