mirror of
https://github.com/planetmint/planetmint.git
synced 2025-11-24 14:35:45 +00:00
removed unused code, updated version number
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
This commit is contained in:
parent
1909330971
commit
816f4dc67c
@ -34,14 +34,13 @@ class DbTransaction:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def from_tuple(transaction: tuple) -> DbTransaction:
|
def from_tuple(transaction: tuple) -> DbTransaction:
|
||||||
|
assets = Asset.from_list_dict(transaction[4])
|
||||||
return DbTransaction(
|
return DbTransaction(
|
||||||
id=transaction[0],
|
id=transaction[0],
|
||||||
operation=transaction[1],
|
operation=transaction[1],
|
||||||
version=transaction[2],
|
version=transaction[2],
|
||||||
metadata=MetaData.from_dict(transaction[3]),
|
metadata=MetaData.from_dict(transaction[3]),
|
||||||
assets=Asset.from_list_dict(transaction[4])
|
assets=assets if transaction[2] != "2.0" else [assets[0]],
|
||||||
if transaction[2] != "2.0"
|
|
||||||
else Asset.from_dict(transaction[4][0]),
|
|
||||||
inputs=Input.from_list_dict(transaction[5]),
|
inputs=Input.from_list_dict(transaction[5]),
|
||||||
script=Script.from_dict(transaction[6]),
|
script=Script.from_dict(transaction[6]),
|
||||||
)
|
)
|
||||||
@ -63,12 +62,13 @@ class DbTransaction:
|
|||||||
return output
|
return output
|
||||||
|
|
||||||
def to_dict(self) -> dict:
|
def to_dict(self) -> dict:
|
||||||
|
assets = Asset.list_to_dict(self.assets)
|
||||||
tx = {
|
tx = {
|
||||||
"inputs": Input.list_to_dict(self.inputs),
|
"inputs": Input.list_to_dict(self.inputs),
|
||||||
"outputs": Output.list_to_dict(self.outputs),
|
"outputs": Output.list_to_dict(self.outputs),
|
||||||
"operation": self.operation,
|
"operation": self.operation,
|
||||||
"metadata": self.metadata.to_dict() if self.metadata is not None else None,
|
"metadata": self.metadata.to_dict() if self.metadata is not None else None,
|
||||||
"assets": Asset.list_to_dict(self.assets) if self.version != "2.0" else Asset.to_dict(self.assets),
|
"assets": assets if self.version != "2.0" else assets[0],
|
||||||
"version": self.version,
|
"version": self.version,
|
||||||
"id": self.id,
|
"id": self.id,
|
||||||
"script": self.script.to_dict() if self.script is not None else None,
|
"script": self.script.to_dict() if self.script is not None else None,
|
||||||
|
|||||||
@ -97,13 +97,9 @@ class TarantoolDBConnection(DBConnection):
|
|||||||
|
|
||||||
def drop_database(self):
|
def drop_database(self):
|
||||||
self.connect().call("drop")
|
self.connect().call("drop")
|
||||||
# db_config = Config().get()["database"]
|
|
||||||
# cmd_resp = self.run_command(command=self.drop_path, config=db_config) # noqa: F841
|
|
||||||
|
|
||||||
def init_database(self):
|
def init_database(self):
|
||||||
self.connect().call("init")
|
self.connect().call("init")
|
||||||
# db_config = Config().get()["database"]
|
|
||||||
# cmd_resp = self.run_command(command=self.init_path, config=db_config) # noqa: F841
|
|
||||||
|
|
||||||
def run_command(self, command: str, config: dict):
|
def run_command(self, command: str, config: dict):
|
||||||
from subprocess import run
|
from subprocess import run
|
||||||
|
|||||||
@ -3,8 +3,8 @@
|
|||||||
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
|
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
|
||||||
# Code is Apache-2.0 and docs are CC-BY-4.0
|
# Code is Apache-2.0 and docs are CC-BY-4.0
|
||||||
|
|
||||||
__version__ = "1.4.1"
|
__version__ = "2.0.0"
|
||||||
__short_version__ = "1.4"
|
__short_version__ = "2.0"
|
||||||
|
|
||||||
# Supported Tendermint versions
|
# Supported Tendermint versions
|
||||||
__tm_supported_versions__ = ["0.34.15"]
|
__tm_supported_versions__ = ["0.34.15"]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user