fixed global variable of backend

This commit is contained in:
andrei 2022-04-25 12:22:24 +03:00
parent b0cb0193ff
commit 2e749f64ef
2 changed files with 3 additions and 1 deletions

View File

@ -43,7 +43,7 @@ services:
- ./pytest.ini:/usr/src/app/pytest.ini - ./pytest.ini:/usr/src/app/pytest.ini
- ./tox.ini:/usr/src/app/tox.ini - ./tox.ini:/usr/src/app/tox.ini
environment: environment:
PLANETMINT_DATABASE_BACKEND: tarantooldb PLANETMINT_DATABASE_BACKEND: tarantool_db
PLANETMINT_DATABASE_HOST: tarantool PLANETMINT_DATABASE_HOST: tarantool
PLANETMINT_DATABASE_PORT: 3303 PLANETMINT_DATABASE_PORT: 3303
PLANETMINT_SERVER_BIND: 0.0.0.0:9984 PLANETMINT_SERVER_BIND: 0.0.0.0:9984

View File

@ -78,6 +78,7 @@ class Planetmint(object):
self.validation = BaseValidationRules self.validation = BaseValidationRules
# planetmint.backend.tarantool.connection_tarantool.connect(**Config().get()['database']) # planetmint.backend.tarantool.connection_tarantool.connect(**Config().get()['database'])
self.connection = connection if connection is not None else planetmint.backend.Connection() self.connection = connection if connection is not None else planetmint.backend.Connection()
print(f"PLANETMINT self.connection {self.connection} !!!!")
def post_transaction(self, transaction, mode): def post_transaction(self, transaction, mode):
"""Submit a valid transaction to the mempool.""" """Submit a valid transaction to the mempool."""
@ -457,6 +458,7 @@ class Planetmint(object):
return backend.query.get_election(self.connection, election_id) return backend.query.get_election(self.connection, election_id)
def get_pre_commit_state(self): def get_pre_commit_state(self):
print(f"CONNECTION {self.connection} !!!!!")
return backend.query.get_pre_commit_state(self.connection) return backend.query.get_pre_commit_state(self.connection)
def store_pre_commit_state(self, state): def store_pre_commit_state(self, state):