mirror of
https://github.com/planetmint/planetmint.git
synced 2025-07-06 04:32:29 +00:00
79 hotfix election validation bckwrd compat (#319)
* fixed election and voting backward compatibility issues * bumped version! * fixed changed testcases and a bug * blackified * blackified with newest verion to satisfy CI * fix dependency management issue --------- Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
This commit is contained in:
parent
2bb0539b78
commit
811f89e5a6
@ -25,6 +25,9 @@ For reference, the possible headings are:
|
|||||||
* **Known Issues**
|
* **Known Issues**
|
||||||
* **Notes**
|
* **Notes**
|
||||||
|
|
||||||
|
## [2.2.3] - 2023-14-02
|
||||||
|
* **fixed** fixed voting/election backward compatibility issue (using planetmint-transactions >= 0.7.0) on the 2.2 main branch
|
||||||
|
|
||||||
## [2.2.2] - 2023-31-01
|
## [2.2.2] - 2023-31-01
|
||||||
* **Fixed** catching tarantool exceptions in case tarantool drivers throw execeptions due to concurrency issues. This issue got idenitfied during the testing of the planetmint-driver-ts.
|
* **Fixed** catching tarantool exceptions in case tarantool drivers throw execeptions due to concurrency issues. This issue got idenitfied during the testing of the planetmint-driver-ts.
|
||||||
|
|
||||||
@ -39,6 +42,9 @@ For reference, the possible headings are:
|
|||||||
* **Removed** removed text_search routes
|
* **Removed** removed text_search routes
|
||||||
* **Added** metadata / asset cid route for fetching transactions
|
* **Added** metadata / asset cid route for fetching transactions
|
||||||
|
|
||||||
|
## [1.4.2] - 2023-14-02
|
||||||
|
* **fixed** fixed voting/election backward compatibility issue (using planetmint-transactions >= 0.7.0)
|
||||||
|
|
||||||
## [1.4.1] - 2022-21-12
|
## [1.4.1] - 2022-21-12
|
||||||
* **fixed** inconsistent cryptocondition keyring tag handling. Using cryptoconditions > 1.1.0 from now on.
|
* **fixed** inconsistent cryptocondition keyring tag handling. Using cryptoconditions > 1.1.0 from now on.
|
||||||
|
|
||||||
|
@ -676,7 +676,7 @@ class Planetmint(object):
|
|||||||
current_validators = self.get_validators_dict()
|
current_validators = self.get_validators_dict()
|
||||||
|
|
||||||
# NOTE: change more than 1/3 of the current power is not allowed
|
# NOTE: change more than 1/3 of the current power is not allowed
|
||||||
if transaction.assets[0]["data"]["power"] >= (1 / 3) * sum(current_validators.values()):
|
if transaction.get_assets()[0]["data"]["power"] >= (1 / 3) * sum(current_validators.values()):
|
||||||
raise InvalidPowerChange("`power` change must be less than 1/3 of total power")
|
raise InvalidPowerChange("`power` change must be less than 1/3 of total power")
|
||||||
|
|
||||||
def get_election_status(self, transaction):
|
def get_election_status(self, transaction):
|
||||||
@ -734,7 +734,6 @@ class Planetmint(object):
|
|||||||
def show_election_status(self, transaction):
|
def show_election_status(self, transaction):
|
||||||
data = transaction.assets[0]
|
data = transaction.assets[0]
|
||||||
data = data.to_dict()["data"]
|
data = data.to_dict()["data"]
|
||||||
|
|
||||||
if "public_key" in data.keys():
|
if "public_key" in data.keys():
|
||||||
data["public_key"] = public_key_to_base64(data["public_key"]["value"])
|
data["public_key"] = public_key_to_base64(data["public_key"]["value"])
|
||||||
response = ""
|
response = ""
|
||||||
@ -815,8 +814,7 @@ class Planetmint(object):
|
|||||||
for tx in txns:
|
for tx in txns:
|
||||||
if not isinstance(tx, Vote):
|
if not isinstance(tx, Vote):
|
||||||
continue
|
continue
|
||||||
|
election_id = Transaction.read_out_asset_id(tx)
|
||||||
election_id = tx.assets[0]["id"]
|
|
||||||
if election_id not in elections:
|
if election_id not in elections:
|
||||||
elections[election_id] = []
|
elections[election_id] = []
|
||||||
elections[election_id].append(tx)
|
elections[election_id].append(tx)
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
# 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__ = "2.2.2"
|
__version__ = "2.2.3"
|
||||||
__short_version__ = "2.2"
|
__short_version__ = "2.2"
|
||||||
|
|
||||||
# Supported Tendermint versions
|
# Supported Tendermint versions
|
||||||
|
4
setup.py
4
setup.py
@ -66,7 +66,7 @@ docs_require = [
|
|||||||
"pyparsing==3.0.8",
|
"pyparsing==3.0.8",
|
||||||
"pytz==2022.1",
|
"pytz==2022.1",
|
||||||
"PyYAML>=5.4.0",
|
"PyYAML>=5.4.0",
|
||||||
"requests>=2.25i.1",
|
"requests>=2.25.1",
|
||||||
"six==1.16.0",
|
"six==1.16.0",
|
||||||
"snowballstemmer==2.2.0",
|
"snowballstemmer==2.2.0",
|
||||||
"Sphinx==4.5.0",
|
"Sphinx==4.5.0",
|
||||||
@ -129,7 +129,7 @@ install_requires = [
|
|||||||
"planetmint-ipld>=0.0.3",
|
"planetmint-ipld>=0.0.3",
|
||||||
"pyasn1>=0.4.8",
|
"pyasn1>=0.4.8",
|
||||||
"python-decouple",
|
"python-decouple",
|
||||||
"planetmint-transactions>=0.6.0",
|
"planetmint-transactions>=0.7.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user