Documentation ¶
Index ¶
- Constants
- Variables
- type Account
- type AccountBlock
- func (ab *AccountBlock) ComputeHash() types.Hash
- func (ab *AccountBlock) Copy() *AccountBlock
- func (ab *AccountBlock) DbDeserialize(buf []byte) error
- func (ab *AccountBlock) DbProto() *vitepb.AccountBlock
- func (ab *AccountBlock) DbSerialize() ([]byte, error)
- func (ab *AccountBlock) DeProto(pb *vitepb.AccountBlock)
- func (ab *AccountBlock) Deserialize(buf []byte) error
- func (ab *AccountBlock) IsReceiveBlock() bool
- func (ab *AccountBlock) IsSendBlock() bool
- func (ab *AccountBlock) Producer() types.Address
- func (ab *AccountBlock) Proto() *vitepb.AccountBlock
- func (ab *AccountBlock) Serialize() ([]byte, error)
- func (ab *AccountBlock) VerifySignature() bool
- type AccountBlockMeta
- type Block
- type CompressedFileMeta
- type HashHeight
- type SnapshotBlock
- func (sb *SnapshotBlock) ComputeHash() types.Hash
- func (sb *SnapshotBlock) DbSerialize() ([]byte, error)
- func (sb *SnapshotBlock) DeProto(pb *vitepb.SnapshotBlock)
- func (sb *SnapshotBlock) Deserialize(buf []byte) error
- func (sb *SnapshotBlock) Producer() types.Address
- func (sb *SnapshotBlock) Proto() *vitepb.SnapshotBlock
- func (sb *SnapshotBlock) Serialize() ([]byte, error)
- func (sb *SnapshotBlock) VerifySignature() bool
- type SnapshotContent
- type SnapshotContentItem
- type SnapshotContentList
- type VmLog
- type VmLogList
Constants ¶
View Source
const ( AccountTypeError = 0 AccountTypeNotExist = 1 AccountTypeGeneral = 2 AccountTypeContract = 3 )
View Source
const ( BlockTypeSendCreate byte = iota + 1 BlockTypeSendCall BlockTypeSendReward BlockTypeReceive BlockTypeReceiveError BlockTypeSendRefund )
View Source
const ScItemBytesLen = types.AddressSize + types.HashSize + 8
Variables ¶
View Source
var GenesisAccountAddress, _ = types.HexToAddress("vite_60e292f0ac471c73d914aeff10bb25925e13b2a9fddb6e6122")
View Source
var ViteTokenId = types.TokenTypeId{'V', 'I', 'T', 'E', ' ', 'T', 'O', 'K', 'E', 'N'}
Functions ¶
This section is empty.
Types ¶
type Account ¶
func (*Account) Deserialize ¶
type AccountBlock ¶
type AccountBlock struct { Meta *AccountBlockMeta `json:"-"` BlockType byte `json:"blockType"` Hash types.Hash `json:"hash"` Height uint64 `json:"height"` PrevHash types.Hash `json:"prevHash"` AccountAddress types.Address `json:"accountAddress"` PublicKey ed25519.PublicKey `json:"publicKey"` ToAddress types.Address `json:"toAddress"` FromBlockHash types.Hash `json:"fromBlockHash"` Amount *big.Int `json:"amount"` TokenId types.TokenTypeId `json:"tokenId"` Quota uint64 `json:"quota"` Fee *big.Int `json:"fee"` SnapshotHash types.Hash `json:"snapshotHash"` Data []byte `json:"data"` Timestamp *time.Time `json:"timestamp"` StateHash types.Hash `json:"stateHash"` LogHash *types.Hash `json:"logHash"` Difficulty *big.Int `json:"difficulty"` Nonce []byte `json:"nonce"` Signature []byte `json:"signature"` // contains filtered or unexported fields }
func (*AccountBlock) ComputeHash ¶
func (ab *AccountBlock) ComputeHash() types.Hash
func (*AccountBlock) Copy ¶
func (ab *AccountBlock) Copy() *AccountBlock
func (*AccountBlock) DbDeserialize ¶
func (ab *AccountBlock) DbDeserialize(buf []byte) error
func (*AccountBlock) DbProto ¶
func (ab *AccountBlock) DbProto() *vitepb.AccountBlock
func (*AccountBlock) DbSerialize ¶
func (ab *AccountBlock) DbSerialize() ([]byte, error)
func (*AccountBlock) DeProto ¶
func (ab *AccountBlock) DeProto(pb *vitepb.AccountBlock)
func (*AccountBlock) Deserialize ¶
func (ab *AccountBlock) Deserialize(buf []byte) error
func (*AccountBlock) IsReceiveBlock ¶
func (ab *AccountBlock) IsReceiveBlock() bool
func (*AccountBlock) IsSendBlock ¶
func (ab *AccountBlock) IsSendBlock() bool
func (*AccountBlock) Producer ¶
func (ab *AccountBlock) Producer() types.Address
func (*AccountBlock) Proto ¶
func (ab *AccountBlock) Proto() *vitepb.AccountBlock
func (*AccountBlock) Serialize ¶
func (ab *AccountBlock) Serialize() ([]byte, error)
func (*AccountBlock) VerifySignature ¶
func (ab *AccountBlock) VerifySignature() bool
type AccountBlockMeta ¶
type AccountBlockMeta struct { // Account id AccountId uint64 `json:"accountId"` // Height Height uint64 `json:"height"` // Block status, 1 means open, 2 means closed ReceiveBlockHeights []uint64 `json:"receiveBlockHeights"` // Height of Snapshot block which confirm this account block SnapshotHeight uint64 `json:"snapshotHeight"` // Height of Snapshot block which pointed by this account block RefSnapshotHeight uint64 `json:"refSnapshotHeight"` }
func (*AccountBlockMeta) Copy ¶
func (abm *AccountBlockMeta) Copy() *AccountBlockMeta
func (*AccountBlockMeta) DeProto ¶
func (abm *AccountBlockMeta) DeProto(pb *vitepb.AccountBlockMeta)
func (*AccountBlockMeta) Deserialize ¶
func (abm *AccountBlockMeta) Deserialize(buf []byte) error
func (*AccountBlockMeta) Proto ¶
func (abm *AccountBlockMeta) Proto() *vitepb.AccountBlockMeta
func (*AccountBlockMeta) Serialize ¶
func (abm *AccountBlockMeta) Serialize() ([]byte, error)
type CompressedFileMeta ¶
type CompressedFileMeta struct { StartHeight uint64 EndHeight uint64 Filename string FileSize int64 BlockNumbers uint64 }
func (*CompressedFileMeta) Deproto ¶
func (f *CompressedFileMeta) Deproto(pb *vitepb.CompressedFileMeta)
func (*CompressedFileMeta) Deserialize ¶
func (f *CompressedFileMeta) Deserialize(buf []byte) error
func (*CompressedFileMeta) Proto ¶
func (f *CompressedFileMeta) Proto() *vitepb.CompressedFileMeta
func (*CompressedFileMeta) Serialize ¶
func (f *CompressedFileMeta) Serialize() ([]byte, error)
type HashHeight ¶
func (*HashHeight) DeProto ¶
func (b *HashHeight) DeProto(pb *vitepb.BlockID)
func (*HashHeight) Deserialize ¶
func (b *HashHeight) Deserialize(data []byte) error
func (*HashHeight) Proto ¶
func (b *HashHeight) Proto() *vitepb.BlockID
func (*HashHeight) Serialize ¶
func (b *HashHeight) Serialize() ([]byte, error)
type SnapshotBlock ¶
type SnapshotBlock struct { Hash types.Hash `json:"hash"` PrevHash types.Hash `json:"prevHash"` Height uint64 `json:"height"` PublicKey ed25519.PublicKey `json:"publicKey"` Signature []byte `json:"signature"` Timestamp *time.Time `json:"timestamp"` StateHash types.Hash `json:"stateHash"` StateTrie *trie.Trie `json:"-"` SnapshotContent SnapshotContent `json:"snapshotContent"` // contains filtered or unexported fields }
func (*SnapshotBlock) ComputeHash ¶
func (sb *SnapshotBlock) ComputeHash() types.Hash
func (*SnapshotBlock) DbSerialize ¶
func (sb *SnapshotBlock) DbSerialize() ([]byte, error)
func (*SnapshotBlock) DeProto ¶
func (sb *SnapshotBlock) DeProto(pb *vitepb.SnapshotBlock)
func (*SnapshotBlock) Deserialize ¶
func (sb *SnapshotBlock) Deserialize(buf []byte) error
func (*SnapshotBlock) Producer ¶
func (sb *SnapshotBlock) Producer() types.Address
func (*SnapshotBlock) Proto ¶
func (sb *SnapshotBlock) Proto() *vitepb.SnapshotBlock
func (*SnapshotBlock) Serialize ¶
func (sb *SnapshotBlock) Serialize() ([]byte, error)
func (*SnapshotBlock) VerifySignature ¶
func (sb *SnapshotBlock) VerifySignature() bool
type SnapshotContent ¶
type SnapshotContent map[types.Address]*HashHeight
func (SnapshotContent) Bytes ¶ added in v1.3.0
func (sc SnapshotContent) Bytes() []byte
func (SnapshotContent) DeProto ¶
func (sc SnapshotContent) DeProto(pb *vitepb.SnapshotContent)
func (*SnapshotContent) Deserialize ¶
func (sc *SnapshotContent) Deserialize(buf []byte) error
func (SnapshotContent) Proto ¶
func (sc SnapshotContent) Proto() *vitepb.SnapshotContent
func (*SnapshotContent) Serialize ¶
func (sc *SnapshotContent) Serialize() ([]byte, error)
type SnapshotContentItem ¶ added in v1.3.0
type SnapshotContentItem struct { Address *types.Address HashHeight *HashHeight }
func (*SnapshotContentItem) Bytes ¶ added in v1.3.0
func (scItem *SnapshotContentItem) Bytes() []byte
type SnapshotContentList ¶ added in v1.3.0
type SnapshotContentList []*SnapshotContentItem
func NewSnapshotContentList ¶ added in v1.3.0
func NewSnapshotContentList(sc SnapshotContent) SnapshotContentList
func (SnapshotContentList) Len ¶ added in v1.3.0
func (scList SnapshotContentList) Len() int
func (SnapshotContentList) Less ¶ added in v1.3.0
func (scList SnapshotContentList) Less(i, j int) bool
func (SnapshotContentList) Swap ¶ added in v1.3.0
func (scList SnapshotContentList) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.