mirror of
https://github.com/planetmint/planetmint.git
synced 2025-11-25 15:05:49 +00:00
Changed from .space() method to .get_space()
This commit is contained in:
parent
c0d5b088e0
commit
41234a75a7
@ -30,11 +30,9 @@ def test_asset_is_separated_from_transaciton(b):
|
|||||||
from planetmint.transactions.common.crypto import generate_key_pair
|
from planetmint.transactions.common.crypto import generate_key_pair
|
||||||
from planetmint.backend.tarantool.connection import TarantoolDBConnection
|
from planetmint.backend.tarantool.connection import TarantoolDBConnection
|
||||||
|
|
||||||
|
|
||||||
if isinstance(b.connection, TarantoolDBConnection):
|
if isinstance(b.connection, TarantoolDBConnection):
|
||||||
pytest.skip("This specific function is skipped because, assets are stored differently if using Tarantool")
|
pytest.skip("This specific function is skipped because, assets are stored differently if using Tarantool")
|
||||||
|
|
||||||
|
|
||||||
alice = generate_key_pair()
|
alice = generate_key_pair()
|
||||||
bob = generate_key_pair()
|
bob = generate_key_pair()
|
||||||
|
|
||||||
@ -342,7 +340,7 @@ def test_delete_many_unspent_outputs(b, utxoset):
|
|||||||
assert utxo_collection.count_documents(
|
assert utxo_collection.count_documents(
|
||||||
{'transaction_id': 'a', 'output_index': 1}) == 1
|
{'transaction_id': 'a', 'output_index': 1}) == 1
|
||||||
else: # TODO It looks ugly because query.get_unspent_outputs function, has not yet implemented query parameter.
|
else: # TODO It looks ugly because query.get_unspent_outputs function, has not yet implemented query parameter.
|
||||||
utx_space = b.connection.space("utxos")
|
utx_space = b.connection.get_space("utxos")
|
||||||
res1 = utx_space.select(['a', 0], index="id_search").data
|
res1 = utx_space.select(['a', 0], index="id_search").data
|
||||||
res2 = utx_space.select(['b', 0], index="id_search").data
|
res2 = utx_space.select(['b', 0], index="id_search").data
|
||||||
assert len(res1) + len(res2) == 0
|
assert len(res1) + len(res2) == 0
|
||||||
@ -350,7 +348,6 @@ def test_delete_many_unspent_outputs(b, utxoset):
|
|||||||
assert len(res3) == 1
|
assert len(res3) == 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.bdb
|
@pytest.mark.bdb
|
||||||
def test_store_zero_unspent_output(b, utxo_collection):
|
def test_store_zero_unspent_output(b, utxo_collection):
|
||||||
res = b.store_unspent_outputs()
|
res = b.store_unspent_outputs()
|
||||||
@ -370,12 +367,12 @@ def test_store_one_unspent_output(b, unspent_output_1, utxo_collection):
|
|||||||
'output_index': unspent_output_1['output_index']}
|
'output_index': unspent_output_1['output_index']}
|
||||||
) == 1
|
) == 1
|
||||||
else:
|
else:
|
||||||
utx_space = b.connection.space("utxos")
|
utx_space = b.connection.get_space("utxos")
|
||||||
res = utx_space.select([unspent_output_1["transaction_id"], unspent_output_1["output_index"]], index="id_search")
|
res = utx_space.select([unspent_output_1["transaction_id"], unspent_output_1["output_index"]],
|
||||||
|
index="id_search")
|
||||||
assert len(res.data) == 1
|
assert len(res.data) == 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.bdb
|
@pytest.mark.bdb
|
||||||
def test_store_many_unspent_outputs(b, unspent_outputs, utxo_collection):
|
def test_store_many_unspent_outputs(b, unspent_outputs, utxo_collection):
|
||||||
from planetmint.backend.tarantool.connection import TarantoolDBConnection
|
from planetmint.backend.tarantool.connection import TarantoolDBConnection
|
||||||
@ -387,7 +384,7 @@ def test_store_many_unspent_outputs(b, unspent_outputs, utxo_collection):
|
|||||||
{'transaction_id': unspent_outputs[0]['transaction_id']}
|
{'transaction_id': unspent_outputs[0]['transaction_id']}
|
||||||
) == 3
|
) == 3
|
||||||
else:
|
else:
|
||||||
utxo_space = b.connection.space("utxos") # .select([], index="transaction_search").data
|
utxo_space = b.connection.get_space("utxos") # .select([], index="transaction_search").data
|
||||||
res = utxo_space.select([unspent_outputs[0]["transaction_id"]], index="transaction_search")
|
res = utxo_space.select([unspent_outputs[0]["transaction_id"]], index="transaction_search")
|
||||||
assert len(res.data) == 3
|
assert len(res.data) == 3
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user