Documentation ¶
Index ¶
- Constants
- func IsValidAttributeType(usage AttributeUsage) bool
- type Attribute
- type AttributeUsage
- type Block
- type DPOSHeader
- type DposBlock
- type Header
- type Input
- type OutPoint
- type Output
- type OutputPayload
- type OutputType
- type Payload
- type Transaction
- func (tx *Transaction) Deserialize(r io.Reader) error
- func (tx *Transaction) DeserializeUnsigned(r io.Reader) error
- func (tx *Transaction) GetSize() int
- func (tx *Transaction) Hash() common.Uint256
- func (tx *Transaction) IsActivateProducerTx() bool
- func (tx *Transaction) IsCancelProducerTx() bool
- func (tx *Transaction) IsCoinBaseTx() bool
- func (tx *Transaction) IsIllegalBlockTx() bool
- func (tx *Transaction) IsIllegalProposalTx() bool
- func (tx *Transaction) IsIllegalTypeTx() bool
- func (tx *Transaction) IsIllegalVoteTx() bool
- func (tx *Transaction) IsInactiveArbitrators() bool
- func (tx *Transaction) IsNewSideChainPowTx() bool
- func (tx *Transaction) IsProducerRelatedTx() bool
- func (tx *Transaction) IsRechargeToSideChainTx() bool
- func (tx *Transaction) IsRegisterProducerTx() bool
- func (tx *Transaction) IsReturnDepositCoin() bool
- func (tx *Transaction) IsSideChainPowTx() bool
- func (tx *Transaction) IsSidechainIllegalDataTx() bool
- func (tx *Transaction) IsTransferCrossChainAssetTx() bool
- func (tx *Transaction) IsUpdateProducerTx() bool
- func (tx *Transaction) IsUpdateVersion() bool
- func (tx *Transaction) IsWithdrawFromSideChainTx() bool
- func (tx *Transaction) Serialize(w io.Writer) error
- func (tx *Transaction) SerializeUnsigned(w io.Writer) error
- func (tx *Transaction) String() string
- type TransactionVersion
- type TxType
Constants ¶
View Source
const (
InvalidBlockSize int = -1
)
View Source
const (
InvalidTransactionSize = -1
)
Variables ¶
This section is empty.
Functions ¶
func IsValidAttributeType ¶
func IsValidAttributeType(usage AttributeUsage) bool
Types ¶
type Attribute ¶
type Attribute struct { Usage AttributeUsage Data []byte }
func NewAttribute ¶
func NewAttribute(u AttributeUsage, d []byte) Attribute
type AttributeUsage ¶
type AttributeUsage byte
const ( Nonce AttributeUsage = 0x00 Script AttributeUsage = 0x20 Memo AttributeUsage = 0x81 Description AttributeUsage = 0x90 DescriptionUrl AttributeUsage = 0x91 Confirmations AttributeUsage = 0x92 )
func (AttributeUsage) Name ¶
func (it AttributeUsage) Name() string
type Block ¶
type Block struct { Header Transactions []*Transaction }
type DPOSHeader ¶ added in v0.3.0
DPOSHeader represents a POW header + DPOS confirm
func (*DPOSHeader) Deserialize ¶ added in v0.3.0
func (h *DPOSHeader) Deserialize(r io.Reader) error
type Header ¶
type Input ¶
type OutPoint ¶
func OutPointFromBytes ¶
type Output ¶
type Output struct { AssetID common.Uint256 Value common.Fixed64 OutputLock uint32 ProgramHash common.Uint168 Type OutputType Payload OutputPayload }
func (*Output) Deserialize ¶
func (o *Output) Deserialize(r io.Reader, txVersion TransactionVersion) error
type OutputPayload ¶
type OutputType ¶
type OutputType byte
OutputType represents the type of a output payload.
const ( // OTNone indicates there is no payload for this output. OTNone OutputType = iota // OTVote indicates the output payload is a vote. OTVote // OTMapping indicates the output payload is a mapping. OTMapping )
type Payload ¶
type Payload interface { // Get payload data Data(version byte) []byte Serialize(w io.Writer, version byte) error Deserialize(r io.Reader, version byte) error }
Payload define the func for loading the payload data base on payload type which have different structure
func GetPayload ¶
type Transaction ¶
type Transaction struct { Version TransactionVersion // New field added in TxVersionC0 TxType TxType PayloadVersion byte Payload Payload Attributes []*Attribute Inputs []*Input Outputs []*Output LockTime uint32 Programs []*pg.Program Fee common.Fixed64 FeePerKB common.Fixed64 // 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) GetSize ¶
func (tx *Transaction) GetSize() int
func (*Transaction) Hash ¶
func (tx *Transaction) Hash() common.Uint256
func (*Transaction) IsActivateProducerTx ¶ added in v0.3.0
func (tx *Transaction) IsActivateProducerTx() bool
func (*Transaction) IsCancelProducerTx ¶
func (tx *Transaction) IsCancelProducerTx() bool
func (*Transaction) IsCoinBaseTx ¶
func (tx *Transaction) IsCoinBaseTx() bool
func (*Transaction) IsIllegalBlockTx ¶
func (tx *Transaction) IsIllegalBlockTx() bool
func (*Transaction) IsIllegalProposalTx ¶
func (tx *Transaction) IsIllegalProposalTx() bool
func (*Transaction) IsIllegalTypeTx ¶ added in v0.3.0
func (tx *Transaction) IsIllegalTypeTx() bool
func (*Transaction) IsIllegalVoteTx ¶
func (tx *Transaction) IsIllegalVoteTx() bool
func (*Transaction) IsInactiveArbitrators ¶ added in v0.3.0
func (tx *Transaction) IsInactiveArbitrators() bool
func (*Transaction) IsNewSideChainPowTx ¶ added in v0.3.2
func (tx *Transaction) IsNewSideChainPowTx() bool
func (*Transaction) IsProducerRelatedTx ¶ added in v0.3.2
func (tx *Transaction) IsProducerRelatedTx() bool
func (*Transaction) IsRechargeToSideChainTx ¶
func (tx *Transaction) IsRechargeToSideChainTx() bool
func (*Transaction) IsRegisterProducerTx ¶
func (tx *Transaction) IsRegisterProducerTx() bool
func (*Transaction) IsReturnDepositCoin ¶
func (tx *Transaction) IsReturnDepositCoin() bool
func (*Transaction) IsSideChainPowTx ¶
func (tx *Transaction) IsSideChainPowTx() bool
func (*Transaction) IsSidechainIllegalDataTx ¶ added in v0.3.0
func (tx *Transaction) IsSidechainIllegalDataTx() bool
func (*Transaction) IsTransferCrossChainAssetTx ¶
func (tx *Transaction) IsTransferCrossChainAssetTx() bool
func (*Transaction) IsUpdateProducerTx ¶
func (tx *Transaction) IsUpdateProducerTx() bool
func (*Transaction) IsUpdateVersion ¶ added in v0.3.2
func (tx *Transaction) IsUpdateVersion() bool
func (*Transaction) IsWithdrawFromSideChainTx ¶
func (tx *Transaction) IsWithdrawFromSideChainTx() bool
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) String ¶
func (tx *Transaction) String() string
type TransactionVersion ¶
type TransactionVersion byte
const ( TxVersionDefault TransactionVersion = 0x00 TxVersion09 TransactionVersion = 0x09 )
type TxType ¶ added in v0.3.0
type TxType byte
TxType represents different transaction types with different payload format. The TxType range is 0x00 - 0x08. When it is greater than 0x08 it will be interpreted as a TransactionVersion.
const ( CoinBase TxType = 0x00 RegisterAsset TxType = 0x01 TransferAsset TxType = 0x02 Record TxType = 0x03 Deploy TxType = 0x04 SideChainPow TxType = 0x05 RechargeToSideChain TxType = 0x06 WithdrawFromSideChain TxType = 0x07 TransferCrossChainAsset TxType = 0x08 RegisterProducer TxType = 0x09 CancelProducer TxType = 0x0a UpdateProducer TxType = 0x0b ReturnDepositCoin TxType = 0x0c ActivateProducer TxType = 0x0d IllegalProposalEvidence TxType = 0x0e IllegalVoteEvidence TxType = 0x0f IllegalBlockEvidence TxType = 0x10 IllegalSidechainEvidence TxType = 0x11 InactiveArbitrators TxType = 0x12 UpdateVersion TxType = 0x13 )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.