Documentation
¶
Index ¶
- type Handler
- func (dp *Handler) Add(txn *badger.Txn, chainID uint32, utxoID []byte, biValue *big.Int, ...) error
- func (dp *Handler) Get(txn *badger.Txn, utxoIDs [][]byte) ([]*objs.TXOut, [][]byte, []*objs.TXOut, error)
- func (dp *Handler) GetValueForOwner(txn *badger.Txn, owner *objs.Owner, minValue *uint256.Uint256) ([][]byte, *uint256.Uint256, error)
- func (dp *Handler) Init() error
- func (dp *Handler) IsValid(txn *badger.Txn, txs objs.TxVec) ([]*objs.TXOut, error)
- func (dp *Handler) Remove(txn *badger.Txn, utxoID []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct { IsSpent func(txn *badger.Txn, utxoID []byte) (bool, error) // contains filtered or unexported fields }
Handler creates a value owner index of all deposits and allows these deposits to be returned for use in a transaction or for verification.
func (*Handler) Add ¶
func (dp *Handler) Add(txn *badger.Txn, chainID uint32, utxoID []byte, biValue *big.Int, owner *objs.Owner) error
Add will add a deposit to the handler
func (*Handler) Get ¶
func (dp *Handler) Get(txn *badger.Txn, utxoIDs [][]byte) ([]*objs.TXOut, [][]byte, []*objs.TXOut, error)
Get returns four values <found>, <missing>, <spent>, <error> Found returns those deposits that are both known and unspent. Missing returns the utxoIDs of the missing deposits. Spent returns those deposits found that have been spent. An error indicates a failure of the logic and should halt the main.
func (*Handler) GetValueForOwner ¶
func (dp *Handler) GetValueForOwner(txn *badger.Txn, owner *objs.Owner, minValue *uint256.Uint256) ([][]byte, *uint256.Uint256, error)
GetValueForOwner allows a list of utxoIDs to be returned that are equal or greater than the value passed as minValue, and are owned by owner.
Click to show internal directories.
Click to hide internal directories.