Documentation
¶
Index ¶
- Constants
- Variables
- func ParseMessageID(ms *marshalutil.MarshalUtil) (hornet.MessageID, error)
- func ParseOutputID(ms *marshalutil.MarshalUtil) (*iotago.UTXOInputID, error)
- type IterateOption
- type IterateOptions
- type Manager
- func (u *Manager) AddressBalance(address iotago.Address) (balance uint64, dustAllowed bool, ledgerIndex milestone.Index, err error)
- func (u *Manager) AddressBalanceWithoutLocking(address iotago.Address) (balance uint64, dustAllowed bool, err error)
- func (u *Manager) ForEachReceiptTuple(consumer ReceiptTupleConsumer, options ...IterateOption) error
- func (u *Manager) ForEachReceiptTupleMigratedAt(migratedAtIndex milestone.Index, consumer ReceiptTupleConsumer, ...) error
- func (u *Manager) ForEachSpentOutput(consumer SpentConsumer, options ...IterateOption) error
- func (u *Manager) ForEachUnspentOutput(consumer OutputConsumer, options ...IterateOption) error
- func (u *Manager) IsOutputUnspent(output *Output) (bool, error)
- func (u *Manager) MilestoneDiff(msIndex milestone.Index) (*MilestoneDiff, error)
- func (u *Manager) ReadLedgerIndex() milestone.Index
- func (u *Manager) ReadOutputByOutputID(outputID *iotago.UTXOInputID) (*Output, error)
- func (u *Manager) ReadSpentForOutput(output *Output) (*Spent, error)
- func (u *Manager) ReadSpentForOutputID(outputID *iotago.UTXOInputID) (*Spent, error)
- func (u *Manager) SpentOutputs(options ...IterateOption) (Spents, error)
- func (u *Manager) UnspentOutputs(options ...IterateOption) ([]*Output, error)
- func (u *Manager) UnspentTreasuryOutput() (*TreasuryOutput, error)
- type MilestoneDiff
- type Output
- type OutputConsumer
- type Outputs
- type ReceiptTuple
- type ReceiptTupleConsumer
- type Spent
- func (s *Spent) Address() iotago.Address
- func (s *Spent) Amount() uint64
- func (s *Spent) ConfirmationIndex() milestone.Index
- func (s *Spent) MessageID() hornet.MessageID
- func (s *Spent) Output() *Output
- func (s *Spent) OutputID() *iotago.UTXOInputID
- func (s *Spent) OutputType() iotago.OutputType
- func (s *Spent) TargetTransactionID() *iotago.TransactionID
- type SpentConsumer
- type Spents
- type TreasuryOutput
Constants ¶
View Source
const ( UTXOStoreKeyPrefixLedgerMilestoneIndex byte = 0 UTXOStoreKeyPrefixOutput byte = 1 UTXOStoreKeyPrefixUnspent byte = 2 UTXOStoreKeyPrefixSpent byte = 3 UTXOStoreKeyPrefixMilestoneDiffs byte = 4 UTXOStoreKeyPrefixBalances byte = 5 UTXOStoreKeyPrefixTreasuryOutput byte = 6 UTXOStoreKeyPrefixReceipts byte = 7 )
View Source
const ( // A prefix which denotes a spent treasury output. // Do not modify the value since we're writing this as a bool. TreasuryOutputSpentPrefix = 1 // A prefix which denotes an unspent treasury output. // Do not modify the value since we're writing this as a bool. TreasuryOutputUnspentPrefix = 0 )
View Source
const (
OutputIDLength = iotago.TransactionIDLength + serializer.UInt16ByteSize
)
Variables ¶
View Source
var ( // ErrInvalidTreasuryState is returned when the state of the treasury is invalid. ErrInvalidTreasuryState = errors.New("invalid treasury state") )
Functions ¶
func ParseMessageID ¶
func ParseMessageID(ms *marshalutil.MarshalUtil) (hornet.MessageID, error)
func ParseOutputID ¶
func ParseOutputID(ms *marshalutil.MarshalUtil) (*iotago.UTXOInputID, error)
Types ¶
type IterateOption ¶
type IterateOption func(*IterateOptions)
func FilterAddress ¶
func FilterAddress(address iotago.Address) IterateOption
func FilterOutputType ¶
func FilterOutputType(outputType iotago.OutputType) IterateOption
func MaxResultCount ¶
func MaxResultCount(count int) IterateOption
type IterateOptions ¶
type IterateOptions struct {
// contains filtered or unexported fields
}
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func (*Manager) AddressBalance ¶
func (*Manager) AddressBalanceWithoutLocking ¶
func (*Manager) ForEachReceiptTuple ¶
func (u *Manager) ForEachReceiptTuple(consumer ReceiptTupleConsumer, options ...IterateOption) error
ForEachReceiptTuple iterates over all stored receipt tuples.
func (*Manager) ForEachReceiptTupleMigratedAt ¶
func (u *Manager) ForEachReceiptTupleMigratedAt(migratedAtIndex milestone.Index, consumer ReceiptTupleConsumer, options ...IterateOption) error
ForEachReceiptTupleMigratedAt iterates over all stored receipt tuples for a given migrated at index.
func (*Manager) ForEachSpentOutput ¶
func (u *Manager) ForEachSpentOutput(consumer SpentConsumer, options ...IterateOption) error
func (*Manager) ForEachUnspentOutput ¶
func (u *Manager) ForEachUnspentOutput(consumer OutputConsumer, options ...IterateOption) error
func (*Manager) MilestoneDiff ¶
func (u *Manager) MilestoneDiff(msIndex milestone.Index) (*MilestoneDiff, error)
func (*Manager) ReadLedgerIndex ¶
func (*Manager) ReadOutputByOutputID ¶
func (u *Manager) ReadOutputByOutputID(outputID *iotago.UTXOInputID) (*Output, error)
func (*Manager) ReadSpentForOutput ¶
func (*Manager) ReadSpentForOutputID ¶
func (u *Manager) ReadSpentForOutputID(outputID *iotago.UTXOInputID) (*Spent, error)
func (*Manager) SpentOutputs ¶
func (u *Manager) SpentOutputs(options ...IterateOption) (Spents, error)
func (*Manager) UnspentOutputs ¶
func (u *Manager) UnspentOutputs(options ...IterateOption) ([]*Output, error)
func (*Manager) UnspentTreasuryOutput ¶
func (u *Manager) UnspentTreasuryOutput() (*TreasuryOutput, error)
UnspentTreasuryOutput returns the unspent treasury output.
type MilestoneDiff ¶
type MilestoneDiff struct {
// The index of the milestone.
Index milestone.Index
// The outputs newly generated with this diff.
Outputs Outputs
// The outputs spent with this diff.
Spents Spents
// The treasury output this diff generated.
TreasuryOutput *TreasuryOutput
// The treasury output this diff consumed.
SpentTreasuryOutput *TreasuryOutput
// contains filtered or unexported fields
}
MilestoneDiff represents the generated and spent outputs by a milestone's confirmation.
type Output ¶
type Output struct {
// contains filtered or unexported fields
}
func (*Output) AddressBytes ¶
func (*Output) OutputID ¶
func (o *Output) OutputID() *iotago.UTXOInputID
func (*Output) OutputType ¶
func (o *Output) OutputType() iotago.OutputType
type OutputConsumer ¶
type ReceiptTuple ¶
type ReceiptTuple struct {
// The actual receipt.
Receipt *iotago.Receipt `json:"receipt"`
// The index of the milestone which included the receipt.
MilestoneIndex milestone.Index `json:"milestoneIndex"`
}
ReceiptTuple contains a receipt and the index of the milestone which contained the receipt.
type ReceiptTupleConsumer ¶
type ReceiptTupleConsumer func(rt *ReceiptTuple) bool
ReceiptTupleConsumer is a function that consumes a receipt tuple.
type Spent ¶
type Spent struct {
// contains filtered or unexported fields
}
Spent are already spent TXOs (transaction outputs) per address.
func (*Spent) ConfirmationIndex ¶
func (*Spent) OutputID ¶
func (s *Spent) OutputID() *iotago.UTXOInputID
func (*Spent) OutputType ¶
func (s *Spent) OutputType() iotago.OutputType
func (*Spent) TargetTransactionID ¶
func (s *Spent) TargetTransactionID() *iotago.TransactionID
type SpentConsumer ¶
type TreasuryOutput ¶
type TreasuryOutput struct {
// The ID of the milestone which generated this output.
MilestoneID iotago.MilestoneID
// The amount residing on this output.
Amount uint64
// Whether this output was already spent
Spent bool
}
TreasuryOutput represents the output of a treasury transaction.
Click to show internal directories.
Click to hide internal directories.