Documentation ¶
Index ¶
- func IsSortedAndUniqueTransferableInputs(ins []*TransferableInput) bool
- func IsSortedAndUniqueTransferableInputsWithSigners(ins []*TransferableInput, signers [][]*crypto.PrivateKeySECP256K1R) bool
- func IsSortedAndUniqueUTXOIDs(utxos []*UTXOID) bool
- func IsSortedTransferableOutputs(outs []*TransferableOutput, c codec.Codec) bool
- func SortTransferableInputs(ins []*TransferableInput)
- func SortTransferableInputsWithSigners(ins []*TransferableInput, signers [][]*crypto.PrivateKeySECP256K1R)
- func SortTransferableOutputs(outs []*TransferableOutput, c codec.Codec)
- func SortUTXOIDs(utxos []*UTXOID)
- func UniqueID(id ids.ID, prefix uint64, cacher cache.Cacher) ids.ID
- type Addressable
- type Asset
- type FlowChecker
- type Metadata
- type PrefixedState
- func (s *PrefixedState) AVMFunds(id ids.ID) ([]ids.ID, error)
- func (s *PrefixedState) AVMUTXO(id ids.ID) (*UTXO, error)
- func (s *PrefixedState) FundAVMUTXO(utxo *UTXO) error
- func (s *PrefixedState) FundPlatformUTXO(utxo *UTXO) error
- func (s *PrefixedState) PlatformFunds(id ids.ID) ([]ids.ID, error)
- func (s *PrefixedState) PlatformUTXO(id ids.ID) (*UTXO, error)
- func (s *PrefixedState) SpendAVMUTXO(utxoID ids.ID) error
- func (s *PrefixedState) SpendPlatformUTXO(utxoID ids.ID) error
- type State
- func (s *State) IDs(id ids.ID) ([]ids.ID, error)
- func (s *State) SetIDs(id ids.ID, idSlice []ids.ID) error
- func (s *State) SetStatus(id ids.ID, status choices.Status) error
- func (s *State) SetUTXO(id ids.ID, utxo *UTXO) error
- func (s *State) Status(id ids.ID) (choices.Status, error)
- func (s *State) UTXO(id ids.ID) (*UTXO, error)
- type TestTransferable
- type TestVerifiable
- type Transferable
- type TransferableInput
- type TransferableOutput
- type UTXO
- type UTXOID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsSortedAndUniqueTransferableInputs ¶
func IsSortedAndUniqueTransferableInputs(ins []*TransferableInput) bool
IsSortedAndUniqueTransferableInputs ...
func IsSortedAndUniqueTransferableInputsWithSigners ¶
func IsSortedAndUniqueTransferableInputsWithSigners(ins []*TransferableInput, signers [][]*crypto.PrivateKeySECP256K1R) bool
IsSortedAndUniqueTransferableInputsWithSigners returns true if the inputs are sorted and unique
func IsSortedAndUniqueUTXOIDs ¶
IsSortedAndUniqueUTXOIDs ...
func IsSortedTransferableOutputs ¶
func IsSortedTransferableOutputs(outs []*TransferableOutput, c codec.Codec) bool
IsSortedTransferableOutputs returns true if output objects are sorted
func SortTransferableInputs ¶
func SortTransferableInputs(ins []*TransferableInput)
SortTransferableInputs ...
func SortTransferableInputsWithSigners ¶
func SortTransferableInputsWithSigners(ins []*TransferableInput, signers [][]*crypto.PrivateKeySECP256K1R)
SortTransferableInputsWithSigners sorts the inputs and signers based on the input's utxo ID
func SortTransferableOutputs ¶
func SortTransferableOutputs(outs []*TransferableOutput, c codec.Codec)
SortTransferableOutputs sorts output objects
Types ¶
type Addressable ¶
type Addressable interface {
Addresses() [][]byte
}
Addressable is the interface a feature extension must provide to be able to be tracked as a part of the utxo set for a set of addresses
type FlowChecker ¶
type FlowChecker struct {
// contains filtered or unexported fields
}
FlowChecker ...
func (*FlowChecker) Consume ¶
func (fc *FlowChecker) Consume(assetID ids.ID, amount uint64)
Consume ...
type Metadata ¶
type Metadata struct {
// contains filtered or unexported fields
}
Metadata ...
func (*Metadata) Initialize ¶
Initialize set the bytes and ID
type PrefixedState ¶
type PrefixedState struct {
// contains filtered or unexported fields
}
PrefixedState wraps a state object. By prefixing the state, there will be no collisions between different types of objects that have the same hash.
func NewPrefixedState ¶
func NewPrefixedState(db database.Database, codec codec.Codec) *PrefixedState
NewPrefixedState ...
func (*PrefixedState) AVMFunds ¶
AVMFunds returns the mapping from the 32 byte representation of an address to a list of utxo IDs that reference the address.
func (*PrefixedState) AVMUTXO ¶
func (s *PrefixedState) AVMUTXO(id ids.ID) (*UTXO, error)
AVMUTXO attempts to load a utxo from avm's storage.
func (*PrefixedState) FundAVMUTXO ¶
func (s *PrefixedState) FundAVMUTXO(utxo *UTXO) error
FundAVMUTXO adds the provided utxo to the database
func (*PrefixedState) FundPlatformUTXO ¶
func (s *PrefixedState) FundPlatformUTXO(utxo *UTXO) error
FundPlatformUTXO adds the provided utxo to the database
func (*PrefixedState) PlatformFunds ¶
PlatformFunds returns the mapping from the 32 byte representation of an address to a list of utxo IDs that reference the address.
func (*PrefixedState) PlatformUTXO ¶
func (s *PrefixedState) PlatformUTXO(id ids.ID) (*UTXO, error)
PlatformUTXO attempts to load a utxo from platform's storage.
func (*PrefixedState) SpendAVMUTXO ¶
func (s *PrefixedState) SpendAVMUTXO(utxoID ids.ID) error
SpendAVMUTXO consumes the provided platform utxo.
func (*PrefixedState) SpendPlatformUTXO ¶
func (s *PrefixedState) SpendPlatformUTXO(utxoID ids.ID) error
SpendPlatformUTXO consumes the provided platform utxo.
type State ¶
State is a thin wrapper around a database to provide, caching, serialization, and de-serialization.
type TestTransferable ¶
type TestTransferable struct { TestVerifiable Val uint64 `serialize:"true"` }
TestTransferable ...
type Transferable ¶
type Transferable interface { verify.Verifiable // Amount returns how much value this output consumes of the asset in its // transaction. Amount() uint64 }
Transferable is the interface a feature extension must provide to transfer value between features extensions.
type TransferableInput ¶
type TransferableInput struct { UTXOID `serialize:"true"` Asset `serialize:"true"` In Transferable `serialize:"true" json:"input"` }
TransferableInput ...
func (*TransferableInput) Input ¶
func (in *TransferableInput) Input() Transferable
Input returns the feature extension input that this Input is using.
func (*TransferableInput) Verify ¶
func (in *TransferableInput) Verify() error
Verify implements the verify.Verifiable interface
type TransferableOutput ¶
type TransferableOutput struct { Asset `serialize:"true"` Out Transferable `serialize:"true" json:"output"` }
TransferableOutput ...
func (*TransferableOutput) Output ¶
func (out *TransferableOutput) Output() Transferable
Output returns the feature extension output that this Output is using.
func (*TransferableOutput) Verify ¶
func (out *TransferableOutput) Verify() error
Verify implements the verify.Verifiable interface
type UTXO ¶
type UTXO struct { UTXOID `serialize:"true"` Asset `serialize:"true"` Out verify.Verifiable `serialize:"true" json:"output"` }
UTXO ...
type UTXOID ¶
type UTXOID struct { // Serialized: TxID ids.ID `serialize:"true" json:"txID"` OutputIndex uint32 `serialize:"true" json:"outputIndex"` // Symbol is false if the UTXO should be part of the DB Symbol bool // contains filtered or unexported fields }
UTXOID ...
func (*UTXOID) InputSource ¶
InputSource returns the source of the UTXO that this input is spending