mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-27 00:28:10 +00:00
src+test: fix flake8 warning
This commit is contained in:
parent
da4bea34a0
commit
285c845e9b
@ -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:
|
||||
|
@ -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']))
|
||||
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user