mirror of
https://github.com/planetmint/planetmint.git
synced 2025-11-25 15:05:49 +00:00
test_lib test_update_utxoset passing
This commit is contained in:
parent
a96515ee31
commit
bb7f6bc143
@ -335,16 +335,13 @@ def delete_transactions(connection, txn_ids: list):
|
||||
for _id in txn_ids:
|
||||
assets_space.delete(_id, index="txid_search")
|
||||
|
||||
|
||||
@register_query(TarantoolDB)
|
||||
def store_unspent_outputs(connection, *unspent_outputs: list):
|
||||
space = connection.space('utxos')
|
||||
if unspent_outputs:
|
||||
for utxo in unspent_outputs:
|
||||
try:
|
||||
yield space.insert((utxo['transaction_id'], utxo['output_index']))
|
||||
except DuplicateKeyError:
|
||||
# TODO log warning at least
|
||||
pass
|
||||
space.insert((utxo['transaction_id'], utxo['output_index']))
|
||||
|
||||
|
||||
@register_query(TarantoolDB)
|
||||
@ -352,7 +349,7 @@ def delete_unspent_outputs(connection, *unspent_outputs: list):
|
||||
space = connection.space('utxos')
|
||||
if unspent_outputs:
|
||||
for utxo in unspent_outputs:
|
||||
yield space.delete((utxo['transaction_id'], utxo['output_index']))
|
||||
space.delete((utxo['transaction_id'], utxo['output_index']))
|
||||
|
||||
|
||||
@register_query(TarantoolDB)
|
||||
@ -360,6 +357,7 @@ def get_unspent_outputs(connection):
|
||||
space = connection.space('utxos')
|
||||
return space.select()
|
||||
|
||||
|
||||
@register_query(TarantoolDB)
|
||||
def store_pre_commit_state(connection, state: dict):
|
||||
space = connection.space("pre_commits")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user