Documentation ¶
Index ¶
- Constants
- 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 EncodeMultiPubKeyProgramInto(sink *common.ZeroCopySink, pubkeys []keypair.PublicKey, m uint16) error
- func IsValidAttributeType(usage TransactionAttributeUsage) bool
- type Block
- type CoinType
- type Header
- func (bd *Header) Deserialization(source *common.ZeroCopySource) error
- func (bd *Header) Deserialize(w io.Reader) error
- func (bd *Header) GetMessage() []byte
- func (bd *Header) Hash() common.Uint256
- func (bd *Header) Serialization(sink *common.ZeroCopySink) error
- func (bd *Header) Serialize(w io.Writer) error
- func (bd *Header) ToArray() []byte
- type Payload
- type Sig
- type SmartCodeEvent
- type Transaction
- func (tx *Transaction) Deserialization(source *common.ZeroCopySource) error
- func (tx *Transaction) DeserializationUnsigned(source *common.ZeroCopySource) error
- func (self *Transaction) GetSignatureAddresses() ([]common.Address, error)
- func (tx *Transaction) Hash() common.Uint256
- func (tx *Transaction) Serialization(sink *common.ZeroCopySink) error
- func (tx *Transaction) SerializeUnsigned(sink *common.ZeroCopySink) error
- func (tx *Transaction) ToArray() []byte
- func (tx *Transaction) Type() common.InventoryType
- type TransactionAttributeUsage
- type TransactionType
- type TxAttribute
Constants ¶
View Source
const CURR_HEADER_VERSION = 0
View Source
const CURR_TX_VERSION = 0
View Source
const MAX_ATTRIBUTES_LEN = 0
View Source
const MAX_TX_SIZE = 1024 * 1024 // The max size of a transaction to prevent DOS attacks
Variables ¶
This section is empty.
Functions ¶
func AddressFromBookkeepers ¶
func AddressFromMultiPubKeys ¶
func EncodeMultiPubKeyProgramInto ¶ added in v1.2.0
func IsValidAttributeType ¶
func IsValidAttributeType(usage TransactionAttributeUsage) bool
Types ¶
type Block ¶
type Block struct { Header *Header Transactions []*Transaction }
func BlockFromRawBytes ¶ added in v1.0.3
if no error, ownership of param raw is transfered to Transaction
func (*Block) Deserialization ¶ added in v1.0.3
func (self *Block) Deserialization(source *common.ZeroCopySource) error
func (*Block) RebuildMerkleRoot ¶
func (b *Block) RebuildMerkleRoot()
func (*Block) Serialization ¶ added in v1.0.3
func (b *Block) Serialization(sink *common.ZeroCopySink) error
func (*Block) Type ¶
func (b *Block) Type() common.InventoryType
type Header ¶
type Header struct { Version uint32 ChainID uint64 PrevBlockHash common.Uint256 TransactionsRoot common.Uint256 CrossStateRoot common.Uint256 BlockRoot common.Uint256 Timestamp uint32 Height uint32 ConsensusData uint64 ConsensusPayload []byte NextBookkeeper common.Address //Program *program.Program Bookkeepers []keypair.PublicKey SigData [][]byte // contains filtered or unexported fields }
func HeaderFromRawBytes ¶ added in v1.0.3
func (*Header) Deserialization ¶ added in v1.0.3
func (bd *Header) Deserialization(source *common.ZeroCopySource) error
func (*Header) GetMessage ¶
func (*Header) Serialization ¶ added in v1.0.3
func (bd *Header) Serialization(sink *common.ZeroCopySink) error
type Payload ¶
type Payload interface { Deserialization(source *common.ZeroCopySource) error Serialization(sink *common.ZeroCopySink) }
Payload define the func for loading the payload data base on payload type which have different structure
type Sig ¶
func (*Sig) Deserialize ¶
func (this *Sig) Deserialize(source *common.ZeroCopySource) error
type SmartCodeEvent ¶
type Transaction ¶
type Transaction struct { Version byte TxType TransactionType Nonce uint32 ChainID uint64 GasLimit uint64 GasPrice uint64 Payload Payload Attributes []byte //this must be 0 now, Attribute Array length use VarUint encoding, so byte is enough for extension Payer common.Address CoinType CoinType Sigs []Sig Raw []byte // raw transaction data SignedAddr []common.Address // this is assigned when passed signature verification // contains filtered or unexported fields }
func TransactionFromRawBytes ¶ added in v1.0.3
func TransactionFromRawBytes(raw []byte) (*Transaction, error)
if no error, ownership of param raw is transfered to Transaction
func (*Transaction) Deserialization ¶ added in v1.0.3
func (tx *Transaction) Deserialization(source *common.ZeroCopySource) error
Transaction has internal reference of param `source`
func (*Transaction) DeserializationUnsigned ¶ added in v1.2.0
func (tx *Transaction) DeserializationUnsigned(source *common.ZeroCopySource) error
func (*Transaction) GetSignatureAddresses ¶
func (self *Transaction) GetSignatureAddresses() ([]common.Address, error)
func (*Transaction) Hash ¶
func (tx *Transaction) Hash() common.Uint256
func (*Transaction) Serialization ¶ added in v1.0.3
func (tx *Transaction) Serialization(sink *common.ZeroCopySink) error
Serialize the Transaction
func (*Transaction) SerializeUnsigned ¶
func (tx *Transaction) SerializeUnsigned(sink *common.ZeroCopySink) error
func (*Transaction) ToArray ¶
func (tx *Transaction) ToArray() []byte
func (*Transaction) Type ¶
func (tx *Transaction) Type() common.InventoryType
type TransactionAttributeUsage ¶
type TransactionAttributeUsage byte
const ( Nonce TransactionAttributeUsage = 0x00 Script TransactionAttributeUsage = 0x20 DescriptionUrl TransactionAttributeUsage = 0x81 Description TransactionAttributeUsage = 0x90 )
type TransactionType ¶
type TransactionType byte
const ( Deploy TransactionType = 0xd0 Invoke TransactionType = 0xd1 )
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.