mirror of
https://github.com/planetmint/planetmint.git
synced 2025-11-25 06:55:45 +00:00
test_validator passing
This commit is contained in:
parent
58982c2fcf
commit
255d1ee49a
@ -391,10 +391,9 @@ def get_pre_commit_state(connection):
|
|||||||
return {}
|
return {}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@register_query(TarantoolDB)
|
@register_query(TarantoolDB)
|
||||||
def store_validator_set(connection, validators_update: dict):
|
def store_validator_set(conn, validators_update: dict):
|
||||||
space = connection.space("validators")
|
space = conn.space("validators")
|
||||||
_validator = space.select(validators_update["height"], index="height_search", limit=1)
|
_validator = space.select(validators_update["height"], index="height_search", limit=1)
|
||||||
unique_id = token_hex(8) if (len(_validator.data) == 0) else _validator.data[0][0]
|
unique_id = token_hex(8) if (len(_validator.data) == 0) else _validator.data[0][0]
|
||||||
space.upsert((unique_id, validators_update["height"], validators_update["validators"]),
|
space.upsert((unique_id, validators_update["height"], validators_update["validators"]),
|
||||||
|
|||||||
@ -6,7 +6,8 @@ from unittest.mock import patch
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from planetmint.backend.localmongodb import query
|
from planetmint.backend import query
|
||||||
|
# from planetmint.backend.localmongodb import query
|
||||||
from planetmint.upsert_validator import ValidatorElection
|
from planetmint.upsert_validator import ValidatorElection
|
||||||
|
|
||||||
|
|
||||||
@ -44,3 +45,7 @@ def inconclusive_election(b, ongoing_validator_election, new_validator):
|
|||||||
|
|
||||||
query.store_validator_set(b.connection, validator_update)
|
query.store_validator_set(b.connection, validator_update)
|
||||||
return ongoing_validator_election
|
return ongoing_validator_election
|
||||||
|
|
||||||
|
|
||||||
|
# ERROR tests/upsert_validator/test_validator_election.py::test_get_status_concluded - AttributeError: 'TarantoolDB' object has no attribute 'run'
|
||||||
|
# ERROR tests/upsert_validator/test_validator_election.py::test_get_status_inconclusive - AttributeError: 'TarantoolDB' object has no attribute 'run'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user