Class MemoryUTXOSet
This is a simple UTXOSet, used when the AA behavior is desired
Most unittests do not need a fully-fledged UTXOSet with all the DB and serialization that comes with it, instead relying on an associative array and a delegate.
Since this pattern is so common, this class is offered as a mean to achieve this without code duplication. See issue #501 for history.
Note that this should *NOT* be used to replace the above UTXOSet, when for example doing integration tests with LocalRest.
Fields
Name | Type | Description |
---|---|---|
storage
|
UTXO[geod24 | UTXO cache backed by an AA |
Methods
Name | Description |
---|---|
clear
()
|
Clear the UTXO cache |
getUTXOs
(pubkey)
|
Get UTXOs from the UTXO set |
length
()
|
|
opApply
(dg)
|
|
peekUTXO
(utxo, value)
|
|
put
(tx)
|
Short hand to add a transaction |
clear
()
|
Clear the UTXO cache |
findUTXO
(utxo, value)
|
Get an UTXO, does not return double spend. |
getUTXOFinder
()
|
Prepare tracking double-spent transactions and return the UTXOFinder delegate |
updateUTXOCache
(tx, height, commons_budget)
|
Add all of a transaction's outputs to the Utxo set, and remove the spent outputs in the transaction from the set. |
updateUTXOLock
(utxo, unlock_height)
|
Update lock height of a UTXO |
add
(utxo, value)
|
|
remove
(utxo)
|
|
getUTXO
(utxo)
|
Get an UTXO from the UTXO set. |