Documentation ¶
Overview ¶
Package bc is a generated protocol buffer package.
It is generated from these files:
bc.proto
It has these top-level messages:
Hash Program AssetID AssetAmount AssetDefinition ValueSource ValueDestination BlockHeader TxHeader TxVerifyResult TransactionStatus Mux Coinbase IntraChainOutput CrossChainOutput VoteOutput VetoInput Retirement Spend CrossChainInput
Index ¶
- Variables
- type AssetAmount
- func (*AssetAmount) Descriptor() ([]byte, []int)
- func (a *AssetAmount) Equal(other *AssetAmount) (eq bool, err error)
- func (m *AssetAmount) GetAmount() uint64
- func (m *AssetAmount) GetAssetId() *AssetID
- func (*AssetAmount) ProtoMessage()
- func (a *AssetAmount) ReadFrom(r *blockchain.Reader) (err error)
- func (m *AssetAmount) Reset()
- func (m *AssetAmount) String() string
- func (a AssetAmount) WriteTo(w io.Writer) (int64, error)
- type AssetDefinition
- func (ad *AssetDefinition) ComputeAssetID() (assetID AssetID)
- func (*AssetDefinition) Descriptor() ([]byte, []int)
- func (m *AssetDefinition) GetData() *Hash
- func (m *AssetDefinition) GetIssuanceProgram() *Program
- func (*AssetDefinition) ProtoMessage()
- func (m *AssetDefinition) Reset()
- func (m *AssetDefinition) String() string
- type AssetID
- func (a AssetID) Byte32() (b32 [32]byte)
- func (a AssetID) Bytes() []byte
- func (*AssetID) Descriptor() ([]byte, []int)
- func (m *AssetID) GetV0() uint64
- func (m *AssetID) GetV1() uint64
- func (m *AssetID) GetV2() uint64
- func (m *AssetID) GetV3() uint64
- func (a *AssetID) IsZero() bool
- func (a AssetID) MarshalText() ([]byte, error)
- func (*AssetID) ProtoMessage()
- func (a *AssetID) ReadFrom(r io.Reader) (int64, error)
- func (m *AssetID) Reset()
- func (m *AssetID) String() string
- func (a *AssetID) UnmarshalJSON(b []byte) error
- func (a *AssetID) UnmarshalText(b []byte) error
- func (a AssetID) WriteTo(w io.Writer) (int64, error)
- type Block
- type BlockHeader
- func (*BlockHeader) Descriptor() ([]byte, []int)
- func (m *BlockHeader) GetHeight() uint64
- func (m *BlockHeader) GetPreviousBlockId() *Hash
- func (m *BlockHeader) GetTimestamp() uint64
- func (m *BlockHeader) GetTransactionStatus() *TransactionStatus
- func (m *BlockHeader) GetTransactionStatusHash() *Hash
- func (m *BlockHeader) GetTransactionsRoot() *Hash
- func (m *BlockHeader) GetVersion() uint64
- func (m *BlockHeader) GetWitnessArguments() [][]byte
- func (*BlockHeader) ProtoMessage()
- func (m *BlockHeader) Reset()
- func (m *BlockHeader) String() string
- type Coinbase
- func (*Coinbase) Descriptor() ([]byte, []int)
- func (m *Coinbase) GetArbitrary() []byte
- func (m *Coinbase) GetWitnessDestination() *ValueDestination
- func (*Coinbase) ProtoMessage()
- func (m *Coinbase) Reset()
- func (c *Coinbase) SetDestination(id *Hash, val *AssetAmount, pos uint64)
- func (m *Coinbase) String() string
- type CrossChainInput
- func (*CrossChainInput) Descriptor() ([]byte, []int)
- func (m *CrossChainInput) GetAssetDefinition() *AssetDefinition
- func (m *CrossChainInput) GetControlProgram() *Program
- func (m *CrossChainInput) GetMainchainOutputId() *Hash
- func (m *CrossChainInput) GetOrdinal() uint64
- func (m *CrossChainInput) GetRawDefinitionByte() []byte
- func (m *CrossChainInput) GetWitnessArguments() [][]byte
- func (m *CrossChainInput) GetWitnessDestination() *ValueDestination
- func (*CrossChainInput) ProtoMessage()
- func (m *CrossChainInput) Reset()
- func (cci *CrossChainInput) SetDestination(id *Hash, val *AssetAmount, pos uint64)
- func (m *CrossChainInput) String() string
- type CrossChainOutput
- func (*CrossChainOutput) Descriptor() ([]byte, []int)
- func (m *CrossChainOutput) GetControlProgram() *Program
- func (m *CrossChainOutput) GetOrdinal() uint64
- func (m *CrossChainOutput) GetSource() *ValueSource
- func (*CrossChainOutput) ProtoMessage()
- func (m *CrossChainOutput) Reset()
- func (m *CrossChainOutput) String() string
- type Entry
- type Hash
- func (h Hash) Byte32() (b32 [32]byte)
- func (h Hash) Bytes() []byte
- func (*Hash) Descriptor() ([]byte, []int)
- func (m *Hash) GetV0() uint64
- func (m *Hash) GetV1() uint64
- func (m *Hash) GetV2() uint64
- func (m *Hash) GetV3() uint64
- func (h *Hash) IsZero() bool
- func (h Hash) MarshalText() ([]byte, error)
- func (*Hash) ProtoMessage()
- func (h *Hash) ReadFrom(r io.Reader) (int64, error)
- func (m *Hash) Reset()
- func (m *Hash) String() string
- func (h *Hash) UnmarshalJSON(b []byte) error
- func (h *Hash) UnmarshalText(v []byte) error
- func (h Hash) WriteTo(w io.Writer) (int64, error)
- type IntraChainOutput
- func (*IntraChainOutput) Descriptor() ([]byte, []int)
- func (m *IntraChainOutput) GetControlProgram() *Program
- func (m *IntraChainOutput) GetOrdinal() uint64
- func (m *IntraChainOutput) GetSource() *ValueSource
- func (*IntraChainOutput) ProtoMessage()
- func (m *IntraChainOutput) Reset()
- func (m *IntraChainOutput) String() string
- type Mux
- func (*Mux) Descriptor() ([]byte, []int)
- func (m *Mux) GetProgram() *Program
- func (m *Mux) GetSources() []*ValueSource
- func (m *Mux) GetWitnessArguments() [][]byte
- func (m *Mux) GetWitnessDestinations() []*ValueDestination
- func (*Mux) ProtoMessage()
- func (m *Mux) Reset()
- func (m *Mux) String() string
- type Program
- type Retirement
- type Spend
- func (*Spend) Descriptor() ([]byte, []int)
- func (m *Spend) GetOrdinal() uint64
- func (m *Spend) GetSpentOutputId() *Hash
- func (m *Spend) GetWitnessArguments() [][]byte
- func (m *Spend) GetWitnessDestination() *ValueDestination
- func (*Spend) ProtoMessage()
- func (m *Spend) Reset()
- func (s *Spend) SetDestination(id *Hash, val *AssetAmount, pos uint64)
- func (m *Spend) String() string
- type TransactionStatus
- func (*TransactionStatus) Descriptor() ([]byte, []int)
- func (ts *TransactionStatus) GetStatus(i int) (bool, error)
- func (m *TransactionStatus) GetVerifyStatus() []*TxVerifyResult
- func (m *TransactionStatus) GetVersion() uint64
- func (*TransactionStatus) ProtoMessage()
- func (m *TransactionStatus) Reset()
- func (ts *TransactionStatus) SetStatus(i int, gasOnly bool) error
- func (m *TransactionStatus) String() string
- type Tx
- func (tx *Tx) CrossChainOutput(id Hash) (*CrossChainOutput, error)
- func (tx *Tx) Entry(id Hash) (Entry, error)
- func (tx *Tx) IntraChainOutput(id Hash) (*IntraChainOutput, error)
- func (tx *Tx) SigHash(n uint32) (hash Hash)
- func (tx *Tx) Spend(id Hash) (*Spend, error)
- func (tx *Tx) VetoInput(id Hash) (*VetoInput, error)
- func (tx *Tx) VoteOutput(id Hash) (*VoteOutput, error)
- type TxHeader
- func (*TxHeader) Descriptor() ([]byte, []int)
- func (m *TxHeader) GetResultIds() []*Hash
- func (m *TxHeader) GetSerializedSize() uint64
- func (m *TxHeader) GetTimeRange() uint64
- func (m *TxHeader) GetVersion() uint64
- func (*TxHeader) ProtoMessage()
- func (m *TxHeader) Reset()
- func (m *TxHeader) String() string
- type TxVerifyResult
- type ValueDestination
- func (*ValueDestination) Descriptor() ([]byte, []int)
- func (m *ValueDestination) GetPosition() uint64
- func (m *ValueDestination) GetRef() *Hash
- func (m *ValueDestination) GetValue() *AssetAmount
- func (*ValueDestination) ProtoMessage()
- func (m *ValueDestination) Reset()
- func (m *ValueDestination) String() string
- type ValueSource
- type VetoInput
- func (*VetoInput) Descriptor() ([]byte, []int)
- func (m *VetoInput) GetOrdinal() uint64
- func (m *VetoInput) GetSpentOutputId() *Hash
- func (m *VetoInput) GetWitnessArguments() [][]byte
- func (m *VetoInput) GetWitnessDestination() *ValueDestination
- func (*VetoInput) ProtoMessage()
- func (m *VetoInput) Reset()
- func (s *VetoInput) SetDestination(id *Hash, val *AssetAmount, pos uint64)
- func (m *VetoInput) String() string
- type VoteOutput
- func (*VoteOutput) Descriptor() ([]byte, []int)
- func (m *VoteOutput) GetControlProgram() *Program
- func (m *VoteOutput) GetOrdinal() uint64
- func (m *VoteOutput) GetSource() *ValueSource
- func (m *VoteOutput) GetVote() []byte
- func (*VoteOutput) ProtoMessage()
- func (m *VoteOutput) Reset()
- func (m *VoteOutput) String() string
Constants ¶
This section is empty.
Variables ¶
var ( ErrEntryType = errors.New("invalid entry type") ErrMissingEntry = errors.New("missing entry") )
Convenience routines for accessing entries of specific types by ID.
var EmptyStringHash = NewHash(sha3.Sum256(nil))
EmptyStringHash represents a 256-bit hash.
Functions ¶
This section is empty.
Types ¶
type AssetAmount ¶
type AssetAmount struct { AssetId *AssetID `protobuf:"bytes,1,opt,name=asset_id,json=assetId" json:"asset_id,omitempty"` Amount uint64 `protobuf:"varint,2,opt,name=amount" json:"amount,omitempty"` }
func (*AssetAmount) Descriptor ¶
func (*AssetAmount) Descriptor() ([]byte, []int)
func (*AssetAmount) Equal ¶
func (a *AssetAmount) Equal(other *AssetAmount) (eq bool, err error)
Equal check does two AssetAmount have same assetID and amount
func (*AssetAmount) GetAmount ¶
func (m *AssetAmount) GetAmount() uint64
func (*AssetAmount) GetAssetId ¶
func (m *AssetAmount) GetAssetId() *AssetID
func (*AssetAmount) ProtoMessage ¶
func (*AssetAmount) ProtoMessage()
func (*AssetAmount) ReadFrom ¶
func (a *AssetAmount) ReadFrom(r *blockchain.Reader) (err error)
ReadFrom read the AssetAmount from the bytes
func (*AssetAmount) Reset ¶
func (m *AssetAmount) Reset()
func (*AssetAmount) String ¶
func (m *AssetAmount) String() string
type AssetDefinition ¶
type AssetDefinition struct { IssuanceProgram *Program `protobuf:"bytes,1,opt,name=issuance_program,json=issuanceProgram" json:"issuance_program,omitempty"` Data *Hash `protobuf:"bytes,2,opt,name=data" json:"data,omitempty"` }
func (*AssetDefinition) ComputeAssetID ¶
func (ad *AssetDefinition) ComputeAssetID() (assetID AssetID)
ComputeAssetID calculate the asset id from AssetDefinition
func (*AssetDefinition) Descriptor ¶
func (*AssetDefinition) Descriptor() ([]byte, []int)
func (*AssetDefinition) GetData ¶
func (m *AssetDefinition) GetData() *Hash
func (*AssetDefinition) GetIssuanceProgram ¶
func (m *AssetDefinition) GetIssuanceProgram() *Program
func (*AssetDefinition) ProtoMessage ¶
func (*AssetDefinition) ProtoMessage()
func (*AssetDefinition) Reset ¶
func (m *AssetDefinition) Reset()
func (*AssetDefinition) String ¶
func (m *AssetDefinition) String() string
type AssetID ¶
type AssetID struct { V0 uint64 `protobuf:"fixed64,1,opt,name=v0" json:"v0,omitempty"` V1 uint64 `protobuf:"fixed64,2,opt,name=v1" json:"v1,omitempty"` V2 uint64 `protobuf:"fixed64,3,opt,name=v2" json:"v2,omitempty"` V3 uint64 `protobuf:"fixed64,4,opt,name=v3" json:"v3,omitempty"` }
This message type duplicates Hash, above. One alternative is to embed a Hash inside an AssetID. But it's useful for AssetID to be plain old data (without pointers). Another alternative is use Hash in any protobuf types where an AssetID is called for, but it's preferable to have type safety.
func ComputeAssetID ¶
ComputeAssetID implement the assetID calculate logic
func (*AssetID) Descriptor ¶
func (AssetID) MarshalText ¶
MarshalText satisfies the TextMarshaler interface.
func (*AssetID) ProtoMessage ¶
func (*AssetID) ProtoMessage()
func (*AssetID) UnmarshalJSON ¶
UnmarshalJSON satisfies the json.Unmarshaler interface.
func (*AssetID) UnmarshalText ¶
UnmarshalText satisfies the TextUnmarshaler interface.
type Block ¶
type Block struct { *BlockHeader ID Hash Transactions []*Tx }
Block is block struct in bc level
type BlockHeader ¶
type BlockHeader struct { Version uint64 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"` Height uint64 `protobuf:"varint,2,opt,name=height" json:"height,omitempty"` PreviousBlockId *Hash `protobuf:"bytes,3,opt,name=previous_block_id,json=previousBlockId" json:"previous_block_id,omitempty"` Timestamp uint64 `protobuf:"varint,4,opt,name=timestamp" json:"timestamp,omitempty"` TransactionsRoot *Hash `protobuf:"bytes,5,opt,name=transactions_root,json=transactionsRoot" json:"transactions_root,omitempty"` TransactionStatusHash *Hash `protobuf:"bytes,6,opt,name=transaction_status_hash,json=transactionStatusHash" json:"transaction_status_hash,omitempty"` TransactionStatus *TransactionStatus `protobuf:"bytes,7,opt,name=transaction_status,json=transactionStatus" json:"transaction_status,omitempty"` WitnessArguments [][]byte `protobuf:"bytes,8,rep,name=witness_arguments,json=witnessArguments,proto3" json:"witness_arguments,omitempty"` }
func NewBlockHeader ¶
func NewBlockHeader(version, height uint64, previousBlockID *Hash, timestamp uint64, transactionsRoot, transactionStatusHash *Hash, witness [][]byte) *BlockHeader
NewBlockHeader creates a new BlockHeader and populates its body.
func (*BlockHeader) Descriptor ¶
func (*BlockHeader) Descriptor() ([]byte, []int)
func (*BlockHeader) GetHeight ¶
func (m *BlockHeader) GetHeight() uint64
func (*BlockHeader) GetPreviousBlockId ¶
func (m *BlockHeader) GetPreviousBlockId() *Hash
func (*BlockHeader) GetTimestamp ¶
func (m *BlockHeader) GetTimestamp() uint64
func (*BlockHeader) GetTransactionStatus ¶
func (m *BlockHeader) GetTransactionStatus() *TransactionStatus
func (*BlockHeader) GetTransactionStatusHash ¶
func (m *BlockHeader) GetTransactionStatusHash() *Hash
func (*BlockHeader) GetTransactionsRoot ¶
func (m *BlockHeader) GetTransactionsRoot() *Hash
func (*BlockHeader) GetVersion ¶
func (m *BlockHeader) GetVersion() uint64
func (*BlockHeader) GetWitnessArguments ¶
func (m *BlockHeader) GetWitnessArguments() [][]byte
func (*BlockHeader) ProtoMessage ¶
func (*BlockHeader) ProtoMessage()
func (*BlockHeader) Reset ¶
func (m *BlockHeader) Reset()
func (*BlockHeader) String ¶
func (m *BlockHeader) String() string
type Coinbase ¶
type Coinbase struct { WitnessDestination *ValueDestination `protobuf:"bytes,1,opt,name=witness_destination,json=witnessDestination" json:"witness_destination,omitempty"` Arbitrary []byte `protobuf:"bytes,2,opt,name=arbitrary,proto3" json:"arbitrary,omitempty"` }
func (*Coinbase) Descriptor ¶
func (*Coinbase) GetArbitrary ¶
func (*Coinbase) GetWitnessDestination ¶
func (m *Coinbase) GetWitnessDestination() *ValueDestination
func (*Coinbase) ProtoMessage ¶
func (*Coinbase) ProtoMessage()
func (*Coinbase) SetDestination ¶
func (c *Coinbase) SetDestination(id *Hash, val *AssetAmount, pos uint64)
SetDestination is support function for map tx
type CrossChainInput ¶
type CrossChainInput struct { MainchainOutputId *Hash `protobuf:"bytes,1,opt,name=mainchain_output_id,json=mainchainOutputId" json:"mainchain_output_id,omitempty"` WitnessDestination *ValueDestination `protobuf:"bytes,2,opt,name=witness_destination,json=witnessDestination" json:"witness_destination,omitempty"` ControlProgram *Program `protobuf:"bytes,3,opt,name=control_program,json=controlProgram" json:"control_program,omitempty"` AssetDefinition *AssetDefinition `protobuf:"bytes,4,opt,name=asset_definition,json=assetDefinition" json:"asset_definition,omitempty"` WitnessArguments [][]byte `protobuf:"bytes,5,rep,name=witness_arguments,json=witnessArguments,proto3" json:"witness_arguments,omitempty"` Ordinal uint64 `protobuf:"varint,6,opt,name=ordinal" json:"ordinal,omitempty"` RawDefinitionByte []byte `protobuf:"bytes,7,opt,name=rawDefinitionByte,proto3" json:"rawDefinitionByte,omitempty"` }
func NewCrossChainInput ¶
func NewCrossChainInput(mainchainOutputID *Hash, prog *Program, ordinal uint64, assetDef *AssetDefinition, rawDefinitionByte []byte) *CrossChainInput
NewCrossChainInput creates a new CrossChainInput.
func (*CrossChainInput) Descriptor ¶
func (*CrossChainInput) Descriptor() ([]byte, []int)
func (*CrossChainInput) GetAssetDefinition ¶
func (m *CrossChainInput) GetAssetDefinition() *AssetDefinition
func (*CrossChainInput) GetControlProgram ¶
func (m *CrossChainInput) GetControlProgram() *Program
func (*CrossChainInput) GetMainchainOutputId ¶
func (m *CrossChainInput) GetMainchainOutputId() *Hash
func (*CrossChainInput) GetOrdinal ¶
func (m *CrossChainInput) GetOrdinal() uint64
func (*CrossChainInput) GetRawDefinitionByte ¶ added in v1.0.5
func (m *CrossChainInput) GetRawDefinitionByte() []byte
func (*CrossChainInput) GetWitnessArguments ¶
func (m *CrossChainInput) GetWitnessArguments() [][]byte
func (*CrossChainInput) GetWitnessDestination ¶
func (m *CrossChainInput) GetWitnessDestination() *ValueDestination
func (*CrossChainInput) ProtoMessage ¶
func (*CrossChainInput) ProtoMessage()
func (*CrossChainInput) Reset ¶
func (m *CrossChainInput) Reset()
func (*CrossChainInput) SetDestination ¶
func (cci *CrossChainInput) SetDestination(id *Hash, val *AssetAmount, pos uint64)
SetDestination will link the CrossChainInput to the output
func (*CrossChainInput) String ¶
func (m *CrossChainInput) String() string
type CrossChainOutput ¶
type CrossChainOutput struct { Source *ValueSource `protobuf:"bytes,1,opt,name=source" json:"source,omitempty"` ControlProgram *Program `protobuf:"bytes,2,opt,name=control_program,json=controlProgram" json:"control_program,omitempty"` Ordinal uint64 `protobuf:"varint,3,opt,name=ordinal" json:"ordinal,omitempty"` }
func NewCrossChainOutput ¶
func NewCrossChainOutput(source *ValueSource, controlProgram *Program, ordinal uint64) *CrossChainOutput
NewCrossChainOutput creates a new CrossChainOutput.
func (*CrossChainOutput) Descriptor ¶
func (*CrossChainOutput) Descriptor() ([]byte, []int)
func (*CrossChainOutput) GetControlProgram ¶
func (m *CrossChainOutput) GetControlProgram() *Program
func (*CrossChainOutput) GetOrdinal ¶
func (m *CrossChainOutput) GetOrdinal() uint64
func (*CrossChainOutput) GetSource ¶
func (m *CrossChainOutput) GetSource() *ValueSource
func (*CrossChainOutput) ProtoMessage ¶
func (*CrossChainOutput) ProtoMessage()
func (*CrossChainOutput) Reset ¶
func (m *CrossChainOutput) Reset()
func (*CrossChainOutput) String ¶
func (m *CrossChainOutput) String() string
type Entry ¶
Entry is the interface implemented by each addressable unit in a blockchain: transaction components such as spends, issuances, outputs, and retirements (among others), plus blockheaders.
type Hash ¶
type Hash struct { V0 uint64 `protobuf:"fixed64,1,opt,name=v0" json:"v0,omitempty"` V1 uint64 `protobuf:"fixed64,2,opt,name=v1" json:"v1,omitempty"` V2 uint64 `protobuf:"fixed64,3,opt,name=v2" json:"v2,omitempty"` V3 uint64 `protobuf:"fixed64,4,opt,name=v3" json:"v3,omitempty"` }
func EntryID ¶
EntryID computes the identifier of an entry, as the hash of its body plus some metadata.
func (*Hash) Descriptor ¶
func (Hash) MarshalText ¶
MarshalText satisfies the TextMarshaler interface. It returns the bytes of h encoded in hex, for formats that can't hold arbitrary binary data. It never returns an error.
func (*Hash) ProtoMessage ¶
func (*Hash) ProtoMessage()
func (*Hash) UnmarshalJSON ¶
UnmarshalJSON satisfies the json.Unmarshaler interface. If b is a JSON-encoded null, it copies the zero-value into h. Othwerwise, it decodes hex data from b into h.
func (*Hash) UnmarshalText ¶
UnmarshalText satisfies the TextUnmarshaler interface. It decodes hex data from b into h.
type IntraChainOutput ¶
type IntraChainOutput struct { Source *ValueSource `protobuf:"bytes,1,opt,name=source" json:"source,omitempty"` ControlProgram *Program `protobuf:"bytes,2,opt,name=control_program,json=controlProgram" json:"control_program,omitempty"` Ordinal uint64 `protobuf:"varint,3,opt,name=ordinal" json:"ordinal,omitempty"` }
func NewIntraChainOutput ¶
func NewIntraChainOutput(source *ValueSource, controlProgram *Program, ordinal uint64) *IntraChainOutput
NewIntraChainOutput creates a new IntraChainOutput.
func (*IntraChainOutput) Descriptor ¶
func (*IntraChainOutput) Descriptor() ([]byte, []int)
func (*IntraChainOutput) GetControlProgram ¶
func (m *IntraChainOutput) GetControlProgram() *Program
func (*IntraChainOutput) GetOrdinal ¶
func (m *IntraChainOutput) GetOrdinal() uint64
func (*IntraChainOutput) GetSource ¶
func (m *IntraChainOutput) GetSource() *ValueSource
func (*IntraChainOutput) ProtoMessage ¶
func (*IntraChainOutput) ProtoMessage()
func (*IntraChainOutput) Reset ¶
func (m *IntraChainOutput) Reset()
func (*IntraChainOutput) String ¶
func (m *IntraChainOutput) String() string
type Mux ¶
type Mux struct { Sources []*ValueSource `protobuf:"bytes,1,rep,name=sources" json:"sources,omitempty"` Program *Program `protobuf:"bytes,2,opt,name=program" json:"program,omitempty"` WitnessDestinations []*ValueDestination `protobuf:"bytes,3,rep,name=witness_destinations,json=witnessDestinations" json:"witness_destinations,omitempty"` WitnessArguments [][]byte `protobuf:"bytes,4,rep,name=witness_arguments,json=witnessArguments,proto3" json:"witness_arguments,omitempty"` }
func (*Mux) Descriptor ¶
func (*Mux) GetProgram ¶
func (*Mux) GetSources ¶
func (m *Mux) GetSources() []*ValueSource
func (*Mux) GetWitnessArguments ¶
func (*Mux) GetWitnessDestinations ¶
func (m *Mux) GetWitnessDestinations() []*ValueDestination
func (*Mux) ProtoMessage ¶
func (*Mux) ProtoMessage()
type Program ¶
type Program struct { VmVersion uint64 `protobuf:"varint,1,opt,name=vm_version,json=vmVersion" json:"vm_version,omitempty"` Code []byte `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"` }
func (*Program) Descriptor ¶
func (*Program) GetVmVersion ¶
func (*Program) ProtoMessage ¶
func (*Program) ProtoMessage()
type Retirement ¶
type Retirement struct { Source *ValueSource `protobuf:"bytes,1,opt,name=source" json:"source,omitempty"` Ordinal uint64 `protobuf:"varint,2,opt,name=ordinal" json:"ordinal,omitempty"` }
func NewRetirement ¶
func NewRetirement(source *ValueSource, ordinal uint64) *Retirement
NewRetirement creates a new Retirement.
func (*Retirement) Descriptor ¶
func (*Retirement) Descriptor() ([]byte, []int)
func (*Retirement) GetOrdinal ¶
func (m *Retirement) GetOrdinal() uint64
func (*Retirement) GetSource ¶
func (m *Retirement) GetSource() *ValueSource
func (*Retirement) ProtoMessage ¶
func (*Retirement) ProtoMessage()
func (*Retirement) Reset ¶
func (m *Retirement) Reset()
func (*Retirement) String ¶
func (m *Retirement) String() string
type Spend ¶
type Spend struct { SpentOutputId *Hash `protobuf:"bytes,1,opt,name=spent_output_id,json=spentOutputId" json:"spent_output_id,omitempty"` WitnessDestination *ValueDestination `protobuf:"bytes,2,opt,name=witness_destination,json=witnessDestination" json:"witness_destination,omitempty"` WitnessArguments [][]byte `protobuf:"bytes,3,rep,name=witness_arguments,json=witnessArguments,proto3" json:"witness_arguments,omitempty"` Ordinal uint64 `protobuf:"varint,4,opt,name=ordinal" json:"ordinal,omitempty"` }
func (*Spend) Descriptor ¶
func (*Spend) GetOrdinal ¶
func (*Spend) GetSpentOutputId ¶
func (*Spend) GetWitnessArguments ¶
func (*Spend) GetWitnessDestination ¶
func (m *Spend) GetWitnessDestination() *ValueDestination
func (*Spend) ProtoMessage ¶
func (*Spend) ProtoMessage()
func (*Spend) SetDestination ¶
func (s *Spend) SetDestination(id *Hash, val *AssetAmount, pos uint64)
SetDestination will link the spend to the output
type TransactionStatus ¶
type TransactionStatus struct { Version uint64 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"` VerifyStatus []*TxVerifyResult `protobuf:"bytes,2,rep,name=verify_status,json=verifyStatus" json:"verify_status,omitempty"` }
func NewTransactionStatus ¶
func NewTransactionStatus() *TransactionStatus
NewTransactionStatus create a empty TransactionStatus struct
func (*TransactionStatus) Descriptor ¶
func (*TransactionStatus) Descriptor() ([]byte, []int)
func (*TransactionStatus) GetStatus ¶
func (ts *TransactionStatus) GetStatus(i int) (bool, error)
GetStatus get the tx status of given index
func (*TransactionStatus) GetVerifyStatus ¶
func (m *TransactionStatus) GetVerifyStatus() []*TxVerifyResult
func (*TransactionStatus) GetVersion ¶
func (m *TransactionStatus) GetVersion() uint64
func (*TransactionStatus) ProtoMessage ¶
func (*TransactionStatus) ProtoMessage()
func (*TransactionStatus) Reset ¶
func (m *TransactionStatus) Reset()
func (*TransactionStatus) SetStatus ¶
func (ts *TransactionStatus) SetStatus(i int, gasOnly bool) error
SetStatus set the tx status of given index
func (*TransactionStatus) String ¶
func (m *TransactionStatus) String() string
type Tx ¶
type Tx struct { *TxHeader ID Hash Entries map[Hash]Entry InputIDs []Hash // 1:1 correspondence with TxData.Inputs SpentOutputIDs []Hash MainchainOutputIDs []Hash GasInputIDs []Hash }
Tx is a wrapper for the entries-based representation of a transaction.
func (*Tx) CrossChainOutput ¶
func (tx *Tx) CrossChainOutput(id Hash) (*CrossChainOutput, error)
CrossChainOutput try to get the cross-chain output entry by given hash
func (*Tx) IntraChainOutput ¶
func (tx *Tx) IntraChainOutput(id Hash) (*IntraChainOutput, error)
IntraChainOutput try to get the intra-chain output entry by given hash
func (*Tx) VoteOutput ¶
func (tx *Tx) VoteOutput(id Hash) (*VoteOutput, error)
VoteOutput try to get the vote output entry by given hash
type TxHeader ¶
type TxHeader struct { Version uint64 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"` SerializedSize uint64 `protobuf:"varint,2,opt,name=serialized_size,json=serializedSize" json:"serialized_size,omitempty"` TimeRange uint64 `protobuf:"varint,3,opt,name=time_range,json=timeRange" json:"time_range,omitempty"` ResultIds []*Hash `protobuf:"bytes,4,rep,name=result_ids,json=resultIds" json:"result_ids,omitempty"` }
func NewTxHeader ¶
NewTxHeader creates an new TxHeader.
func (*TxHeader) Descriptor ¶
func (*TxHeader) GetResultIds ¶
func (*TxHeader) GetSerializedSize ¶
func (*TxHeader) GetTimeRange ¶
func (*TxHeader) GetVersion ¶
func (*TxHeader) ProtoMessage ¶
func (*TxHeader) ProtoMessage()
type TxVerifyResult ¶
type TxVerifyResult struct {
StatusFail bool `protobuf:"varint,1,opt,name=status_fail,json=statusFail" json:"status_fail,omitempty"`
}
func (*TxVerifyResult) Descriptor ¶
func (*TxVerifyResult) Descriptor() ([]byte, []int)
func (*TxVerifyResult) GetStatusFail ¶
func (m *TxVerifyResult) GetStatusFail() bool
func (*TxVerifyResult) ProtoMessage ¶
func (*TxVerifyResult) ProtoMessage()
func (*TxVerifyResult) Reset ¶
func (m *TxVerifyResult) Reset()
func (*TxVerifyResult) String ¶
func (m *TxVerifyResult) String() string
type ValueDestination ¶
type ValueDestination struct { Ref *Hash `protobuf:"bytes,1,opt,name=ref" json:"ref,omitempty"` Value *AssetAmount `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` Position uint64 `protobuf:"varint,3,opt,name=position" json:"position,omitempty"` }
func (*ValueDestination) Descriptor ¶
func (*ValueDestination) Descriptor() ([]byte, []int)
func (*ValueDestination) GetPosition ¶
func (m *ValueDestination) GetPosition() uint64
func (*ValueDestination) GetRef ¶
func (m *ValueDestination) GetRef() *Hash
func (*ValueDestination) GetValue ¶
func (m *ValueDestination) GetValue() *AssetAmount
func (*ValueDestination) ProtoMessage ¶
func (*ValueDestination) ProtoMessage()
func (*ValueDestination) Reset ¶
func (m *ValueDestination) Reset()
func (*ValueDestination) String ¶
func (m *ValueDestination) String() string
type ValueSource ¶
type ValueSource struct { Ref *Hash `protobuf:"bytes,1,opt,name=ref" json:"ref,omitempty"` Value *AssetAmount `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` Position uint64 `protobuf:"varint,3,opt,name=position" json:"position,omitempty"` }
func (*ValueSource) Descriptor ¶
func (*ValueSource) Descriptor() ([]byte, []int)
func (*ValueSource) GetPosition ¶
func (m *ValueSource) GetPosition() uint64
func (*ValueSource) GetRef ¶
func (m *ValueSource) GetRef() *Hash
func (*ValueSource) GetValue ¶
func (m *ValueSource) GetValue() *AssetAmount
func (*ValueSource) ProtoMessage ¶
func (*ValueSource) ProtoMessage()
func (*ValueSource) Reset ¶
func (m *ValueSource) Reset()
func (*ValueSource) String ¶
func (m *ValueSource) String() string
type VetoInput ¶
type VetoInput struct { SpentOutputId *Hash `protobuf:"bytes,1,opt,name=spent_output_id,json=spentOutputId" json:"spent_output_id,omitempty"` WitnessDestination *ValueDestination `protobuf:"bytes,2,opt,name=witness_destination,json=witnessDestination" json:"witness_destination,omitempty"` WitnessArguments [][]byte `protobuf:"bytes,3,rep,name=witness_arguments,json=witnessArguments,proto3" json:"witness_arguments,omitempty"` Ordinal uint64 `protobuf:"varint,4,opt,name=ordinal" json:"ordinal,omitempty"` }
func NewVetoInput ¶
NewVetoInput creates a new VetoInput.
func (*VetoInput) Descriptor ¶
func (*VetoInput) GetOrdinal ¶
func (*VetoInput) GetSpentOutputId ¶
func (*VetoInput) GetWitnessArguments ¶
func (*VetoInput) GetWitnessDestination ¶
func (m *VetoInput) GetWitnessDestination() *ValueDestination
func (*VetoInput) ProtoMessage ¶
func (*VetoInput) ProtoMessage()
func (*VetoInput) SetDestination ¶
func (s *VetoInput) SetDestination(id *Hash, val *AssetAmount, pos uint64)
SetDestination will link the spend to the output
type VoteOutput ¶
type VoteOutput struct { Source *ValueSource `protobuf:"bytes,1,opt,name=source" json:"source,omitempty"` ControlProgram *Program `protobuf:"bytes,2,opt,name=control_program,json=controlProgram" json:"control_program,omitempty"` Ordinal uint64 `protobuf:"varint,3,opt,name=ordinal" json:"ordinal,omitempty"` Vote []byte `protobuf:"bytes,4,opt,name=vote,proto3" json:"vote,omitempty"` }
func NewVoteOutput ¶
func NewVoteOutput(source *ValueSource, controlProgram *Program, ordinal uint64, vote []byte) *VoteOutput
NewCrossChainOutput creates a new CrossChainOutput.
func (*VoteOutput) Descriptor ¶
func (*VoteOutput) Descriptor() ([]byte, []int)
func (*VoteOutput) GetControlProgram ¶
func (m *VoteOutput) GetControlProgram() *Program
func (*VoteOutput) GetOrdinal ¶
func (m *VoteOutput) GetOrdinal() uint64
func (*VoteOutput) GetSource ¶
func (m *VoteOutput) GetSource() *ValueSource
func (*VoteOutput) GetVote ¶
func (m *VoteOutput) GetVote() []byte
func (*VoteOutput) ProtoMessage ¶
func (*VoteOutput) ProtoMessage()
func (*VoteOutput) Reset ¶
func (m *VoteOutput) Reset()
func (*VoteOutput) String ¶
func (m *VoteOutput) String() string