mirror of
https://github.com/planetmint/planetmint.git
synced 2025-11-24 14:35:45 +00:00
fixed schema validation errors
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
This commit is contained in:
parent
f3b7df661f
commit
50a81c8e50
@ -21,6 +21,7 @@ from transactions.common.exceptions import DatabaseDoesNotExist, ValidationError
|
|||||||
from transactions.types.elections.vote import Vote
|
from transactions.types.elections.vote import Vote
|
||||||
from transactions.types.elections.chain_migration_election import ChainMigrationElection
|
from transactions.types.elections.chain_migration_election import ChainMigrationElection
|
||||||
from transactions.types.elections.validator_utils import election_id_to_public_key
|
from transactions.types.elections.validator_utils import election_id_to_public_key
|
||||||
|
from transactions.common.transaction import Transaction
|
||||||
from planetmint import ValidatorElection, Planetmint
|
from planetmint import ValidatorElection, Planetmint
|
||||||
from planetmint.backend import schema
|
from planetmint.backend import schema
|
||||||
from planetmint.commands import utils
|
from planetmint.commands import utils
|
||||||
@ -203,7 +204,8 @@ def run_election_approve(args, planet):
|
|||||||
logger.error("The key you provided does not match any of the eligible voters in this election.")
|
logger.error("The key you provided does not match any of the eligible voters in this election.")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
inputs = [i for i in tx.inputs if key.public_key in i.owners_before]
|
tx_converted = Transaction.from_dict(tx.to_dict(), True)
|
||||||
|
inputs = [i for i in tx_converted.to_inputs() if key.public_key in i.owners_before]
|
||||||
election_pub_key = election_id_to_public_key(tx.id)
|
election_pub_key = election_id_to_public_key(tx.id)
|
||||||
approval = Vote.generate(inputs, [([election_pub_key], voting_power)], [tx.id]).sign([key.private_key])
|
approval = Vote.generate(inputs, [([election_pub_key], voting_power)], [tx.id]).sign([key.private_key])
|
||||||
planet.validate_transaction(approval)
|
planet.validate_transaction(approval)
|
||||||
|
|||||||
@ -462,7 +462,7 @@ def test_election_approve_without_tendermint(caplog, b, priv_validator_path, new
|
|||||||
with caplog.at_level(logging.INFO):
|
with caplog.at_level(logging.INFO):
|
||||||
approval_id = run_election_approve(args, b)
|
approval_id = run_election_approve(args, b)
|
||||||
assert caplog.records[0].msg == "[SUCCESS] Your vote has been submitted"
|
assert caplog.records[0].msg == "[SUCCESS] Your vote has been submitted"
|
||||||
assert b.get_transaction(approval_id)
|
assert b.get_transaction(approval_id, TARANT_TABLE_GOVERNANCE)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.bdb
|
@pytest.mark.bdb
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user