Documentation ¶
Index ¶
- Variables
- func AddressFromBookkeepers(bookkeepers []keypair.PublicKey) (common.Address, error)
- func AddressFromMultiPubKeys(pubkeys []keypair.PublicKey, m int) (common.Address, error)
- func AddressFromPubKey(pubkey keypair.PublicKey) common.Address
- func IsValidAttributeType(usage TransactionAttributeUsage) bool
- type Block
- func (b *Block) Deserialize(r io.Reader) error
- func (b *Block) FromTrimmedData(r io.Reader) error
- func (b *Block) GetMessage() []byte
- func (b *Block) Hash() common.Uint256
- func (b *Block) RebuildMerkleRoot() error
- func (b *Block) Serialize(w io.Writer) error
- func (bd *Block) SerializeUnsigned(w io.Writer) error
- func (b *Block) ToArray() []byte
- func (b *Block) Trim(w io.Writer) error
- func (b *Block) Type() common.InventoryType
- type Fee
- type Header
- func (bd *Header) Deserialize(r io.Reader) error
- func (bd *Header) DeserializeUnsigned(r io.Reader) error
- func (bd *Header) GetMessage() []byte
- func (bd *Header) Hash() common.Uint256
- func (bd *Header) Serialize(w io.Writer) error
- func (bd *Header) SerializeUnsigned(w io.Writer) error
- func (bd *Header) ToArray() []byte
- type Payload
- type Sig
- type SmartCodeEvent
- type Transaction
- func (tx *Transaction) Deserialize(r io.Reader) error
- func (tx *Transaction) DeserializeUnsigned(r io.Reader) error
- func (tx *Transaction) GetMessage() []byte
- func (tx *Transaction) GetNetworkFee() common.Fixed64
- func (self *Transaction) GetSignatureAddresses() []common.Address
- func (tx *Transaction) GetSysFee() common.Fixed64
- func (tx *Transaction) GetTotalFee() common.Fixed64
- func (tx *Transaction) Hash() common.Uint256
- func (tx *Transaction) Serialize(w io.Writer) error
- func (tx *Transaction) SerializeUnsigned(w io.Writer) error
- func (tx *Transaction) SetHash(hash common.Uint256)
- func (tx *Transaction) ToArray() []byte
- func (tx *Transaction) Type() common.InventoryType
- func (tx *Transaction) Verify() error
- type TransactionAttributeUsage
- type TransactionType
- type TxAttribute
Constants ¶
This section is empty.
Variables ¶
View Source
var TxName = map[TransactionType]string{ BookKeeping: "BookKeeping", IssueAsset: "IssueAsset", Bookkeeper: "Bookkeeper", Claim: "Claim", PrivacyPayload: "PrivacyPayload", RegisterAsset: "RegisterAsset", TransferAsset: "TransferAsset", Record: "Record", Deploy: "Deploy", Invoke: "Invoke", DataFile: "DataFile", Enrollment: "Enrollment", Vote: "Vote", }
Functions ¶
func AddressFromBookkeepers ¶
func AddressFromMultiPubKeys ¶
func IsValidAttributeType ¶
func IsValidAttributeType(usage TransactionAttributeUsage) bool
Types ¶
type Block ¶
type Block struct { Header *Header Transactions []*Transaction // contains filtered or unexported fields }
func (*Block) GetMessage ¶
func (*Block) RebuildMerkleRoot ¶
func (*Block) Type ¶
func (b *Block) Type() common.InventoryType
type Header ¶
type Header struct { Version uint32 PrevBlockHash common.Uint256 TransactionsRoot common.Uint256 BlockRoot common.Uint256 Timestamp uint32 Height uint32 ConsensusData uint64 NextBookkeeper common.Address //Program *program.Program Bookkeepers []keypair.PublicKey SigData [][]byte // contains filtered or unexported fields }
func (*Header) GetMessage ¶
func (*Header) SerializeUnsigned ¶
Serialize the blockheader data without program
type Payload ¶
type Payload interface { //Serialize payload data Serialize(w io.Writer) error Deserialize(r io.Reader) error }
Payload define the func for loading the payload data base on payload type which have different struture
type SmartCodeEvent ¶
type Transaction ¶
type Transaction struct { Version byte TxType TransactionType Nonce uint32 Payload Payload Attributes []*TxAttribute Fee []*Fee NetWorkFee common.Fixed64 Sigs []*Sig // contains filtered or unexported fields }
func (*Transaction) Deserialize ¶
func (tx *Transaction) Deserialize(r io.Reader) error
deserialize the Transaction
func (*Transaction) DeserializeUnsigned ¶
func (tx *Transaction) DeserializeUnsigned(r io.Reader) error
func (*Transaction) GetMessage ¶
func (tx *Transaction) GetMessage() []byte
func (*Transaction) GetNetworkFee ¶
func (tx *Transaction) GetNetworkFee() common.Fixed64
func (*Transaction) GetSignatureAddresses ¶
func (self *Transaction) GetSignatureAddresses() []common.Address
func (*Transaction) GetSysFee ¶
func (tx *Transaction) GetSysFee() common.Fixed64
func (*Transaction) GetTotalFee ¶
func (tx *Transaction) GetTotalFee() common.Fixed64
func (*Transaction) Hash ¶
func (tx *Transaction) Hash() common.Uint256
func (*Transaction) Serialize ¶
func (tx *Transaction) Serialize(w io.Writer) error
Serialize the Transaction
func (*Transaction) SerializeUnsigned ¶
func (tx *Transaction) SerializeUnsigned(w io.Writer) error
Serialize the Transaction data without contracts
func (*Transaction) SetHash ¶
func (tx *Transaction) SetHash(hash common.Uint256)
func (*Transaction) ToArray ¶
func (tx *Transaction) ToArray() []byte
func (*Transaction) Type ¶
func (tx *Transaction) Type() common.InventoryType
func (*Transaction) Verify ¶
func (tx *Transaction) Verify() error
type TransactionAttributeUsage ¶
type TransactionAttributeUsage byte
const ( Nonce TransactionAttributeUsage = 0x00 Script TransactionAttributeUsage = 0x20 DescriptionUrl TransactionAttributeUsage = 0x81 Description TransactionAttributeUsage = 0x90 )
type TransactionType ¶
type TransactionType byte
const ( BookKeeping TransactionType = 0x00 IssueAsset TransactionType = 0x01 Bookkeeper TransactionType = 0x02 Claim TransactionType = 0x03 PrivacyPayload TransactionType = 0x20 RegisterAsset TransactionType = 0x40 TransferAsset TransactionType = 0x80 Record TransactionType = 0x81 Deploy TransactionType = 0xd0 Invoke TransactionType = 0xd1 DataFile TransactionType = 0x12 Enrollment TransactionType = 0x04 Vote TransactionType = 0x05 )
type TxAttribute ¶
type TxAttribute struct { Usage TransactionAttributeUsage Data []byte Size uint32 }
func NewTxAttribute ¶
func NewTxAttribute(u TransactionAttributeUsage, d []byte) TxAttribute
func (*TxAttribute) Deserialize ¶
func (tx *TxAttribute) Deserialize(r io.Reader) error
func (*TxAttribute) GetSize ¶
func (u *TxAttribute) GetSize() uint32
func (*TxAttribute) ToArray ¶
func (tx *TxAttribute) ToArray() []byte
Click to show internal directories.
Click to hide internal directories.