1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-26 08:08:51 +00:00

src+test: fix flake8 warning

This commit is contained in:
Pavol Rusnak 2018-06-12 17:04:47 +02:00
parent da4bea34a0
commit 285c845e9b
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
4 changed files with 18 additions and 17 deletions

View File

@ -50,12 +50,13 @@ def validate_network(network: int) -> int:
def _validate_single_tx(msg: NEMSignTx):
# ensure exactly one transaction is provided
tx_count = bool(msg.transfer) + \
bool(msg.provision_namespace) + \
bool(msg.mosaic_creation) + \
bool(msg.supply_change) + \
bool(msg.aggregate_modification) + \
bool(msg.importance_transfer)
tx_count = \
bool(msg.transfer) + \
bool(msg.provision_namespace) + \
bool(msg.mosaic_creation) + \
bool(msg.supply_change) + \
bool(msg.aggregate_modification) + \
bool(msg.importance_transfer)
if tx_count == 0:
raise ValueError('No transaction provided')
if tx_count > 1:

View File

@ -226,9 +226,9 @@ class TestNemHDNode(unittest.TestCase):
)
encrypted = node.nem_encrypt(unhexlify(test['public']),
unhexlify(test['iv']),
unhexlify(test['salt']),
unhexlify(test['input']))
unhexlify(test['iv']),
unhexlify(test['salt']),
unhexlify(test['input']))
self.assertEqual(encrypted, unhexlify(test['output']))

View File

@ -52,7 +52,7 @@ class TestNemMultisigAggregateModification(unittest.TestCase):
"43aa69177018fc3e2bdbeb259c81cddf24be50eef9c5386db51d82386c41475a"))
self.assertEqual(hashlib.sha3_256(t).digest(True),
unhexlify("cc64ca69bfa95db2ff7ac1e21fe6d27ece189c603200ebc9778d8bb80ca25c3c"))
unhexlify("cc64ca69bfa95db2ff7ac1e21fe6d27ece189c603200ebc9778d8bb80ca25c3c"))
def test_nem_transaction_aggregate_modification_relative_change(self):
# http://bob.nem.ninja:8765/#/aggregate/1fbdae5ba753e68af270930413ae90f671eb8ab58988116684bac0abd5726584

View File

@ -45,13 +45,13 @@ class TestNemMultisig(unittest.TestCase):
def test_nem_multisig_2(self):
# http://chain.nem.ninja/#/multisig/1016cf3bdd61bd57b9b2b07b6ff2dee390279d8d899265bdc23d42360abe2e6c
m = _create_provision_msg(NEM_NETWORK_MAINNET,
59414272,
20000000,
59500672,
"dim",
"",
"NAMESPACEWH4MKFMBCVFERDPOOP4FK7MTBXDPZZA",
5000000000)
59414272,
20000000,
59500672,
"dim",
"",
"NAMESPACEWH4MKFMBCVFERDPOOP4FK7MTBXDPZZA",
5000000000)
base_tx = serialize_provision_namespace(m.transaction, m.provision_namespace, unhexlify("a1df5306355766bd2f9a64efdc089eb294be265987b3359093ae474c051d7d5a"))
m = _create_common_msg(NEM_NETWORK_MAINNET,