From 500d29f43b8de5f4a76e4eed5bdc5eb2b910536e Mon Sep 17 00:00:00 2001 From: gabrielkerekes Date: Wed, 30 Jun 2021 14:20:08 +0200 Subject: [PATCH] chore(cardano): format test fixture files --- common/tests/fixtures/cardano/get_address_byron.json | 10 +++++----- .../fixtures/cardano/get_address_byron.slip39.json | 12 ++++++------ .../get_base_address_with_staking_key_hash.json | 2 +- common/tests/fixtures/cardano/get_public_key.json | 4 ++-- .../fixtures/cardano/get_public_key.slip39.json | 10 +++++----- common/tests/fixtures/cardano/sign_tx.json | 3 ++- tests/device_tests/cardano/test_sign_tx.py | 4 ++-- 7 files changed, 23 insertions(+), 22 deletions(-) diff --git a/common/tests/fixtures/cardano/get_address_byron.json b/common/tests/fixtures/cardano/get_address_byron.json index 24a354557d..a2eda485ca 100644 --- a/common/tests/fixtures/cardano/get_address_byron.json +++ b/common/tests/fixtures/cardano/get_address_byron.json @@ -7,7 +7,7 @@ { "parameters": { "path": "m/44'/1815'/0'/0/0", - "address_type":"byron", + "address_type": "byron", "protocol_magic": 764824073, "network_id": 1 }, @@ -16,7 +16,7 @@ } }, { - "parameters":{ + "parameters": { "path": "m/44'/1815'/0'/0/1", "address_type": "byron", "protocol_magic": 764824073, @@ -33,7 +33,7 @@ "protocol_magic": 764824073, "network_id": 1 }, - "result": { + "result": { "expected_address": "Ae2tdPwUPEZFm6Y7aPZGKMyMAK16yA5pWWKU9g73ncUQNZsAjzjhszenCsq" } }, @@ -49,7 +49,7 @@ } }, { - "parameters":{ + "parameters": { "path": "m/44'/1815'/0'/0/1", "address_type": "byron", "protocol_magic": 42, @@ -66,7 +66,7 @@ "protocol_magic": 42, "network_id": 0 }, - "result": { + "result": { "expected_address": "2657WMsDfac7hr1ioJGr6g7r6JRx4r1My8Rj91tcPTeVjJDpfBYKURrPG2zVLx2Sq" } } diff --git a/common/tests/fixtures/cardano/get_address_byron.slip39.json b/common/tests/fixtures/cardano/get_address_byron.slip39.json index ed6d31a447..3ceb77a162 100644 --- a/common/tests/fixtures/cardano/get_address_byron.slip39.json +++ b/common/tests/fixtures/cardano/get_address_byron.slip39.json @@ -1,9 +1,9 @@ { "setup": { "mnemonic": [ - "extra extend academic bishop cricket bundle tofu goat apart victim enlarge program behavior permit course armed jerky faint language modern", - "extra extend academic acne away best indicate impact square oasis prospect painting voting guest either argue username racism enemy eclipse", - "extra extend academic arcade born dive legal hush gross briefing talent drug much home firefly toxic analysis idea umbrella slice" + "extra extend academic bishop cricket bundle tofu goat apart victim enlarge program behavior permit course armed jerky faint language modern", + "extra extend academic acne away best indicate impact square oasis prospect painting voting guest either argue username racism enemy eclipse", + "extra extend academic arcade born dive legal hush gross briefing talent drug much home firefly toxic analysis idea umbrella slice" ], "passphrase": "TREZOR" }, @@ -11,11 +11,11 @@ { "parameters": { "path": "m/44'/1815'/0'/0/0", - "address_type":"byron", + "address_type": "byron", "protocol_magic": 764824073, - "network_id":1 + "network_id": 1 }, - "result":{ + "result": { "expected_address": "Ae2tdPwUPEYxF9NAMNdd3v2LZoMeWp7gCZiDb6bZzFQeeVASzoP7HC4V9s6" } }, diff --git a/common/tests/fixtures/cardano/get_base_address_with_staking_key_hash.json b/common/tests/fixtures/cardano/get_base_address_with_staking_key_hash.json index 9ef76e7d80..bb3c6328d8 100644 --- a/common/tests/fixtures/cardano/get_base_address_with_staking_key_hash.json +++ b/common/tests/fixtures/cardano/get_base_address_with_staking_key_hash.json @@ -7,7 +7,7 @@ { "parameters": { "path": "m/1852'/1815'/4'/0/0", - "address_type":"base", + "address_type": "base", "staking_key_hash": "1bc428e4720702ebd5dab4fb175324c192dc9bb76cc5da956e3c8dff", "network_id": 1, "protocol_magic": 764824073 diff --git a/common/tests/fixtures/cardano/get_public_key.json b/common/tests/fixtures/cardano/get_public_key.json index d045abb4d6..f115ba5cc5 100644 --- a/common/tests/fixtures/cardano/get_public_key.json +++ b/common/tests/fixtures/cardano/get_public_key.json @@ -5,10 +5,10 @@ }, "tests": [ { - "parameters":{ + "parameters": { "path": "m/44'/1815'/0'" }, - "result":{ + "result": { "public_key": "c0fce1839f1a84c4e770293ac2f5e0875141b29017b7f56ab135352d00ad6966", "chain_code": "07faa161c9f5464315d2855f70fdf1431d5fa39eb838767bf17b69772137452f" } diff --git a/common/tests/fixtures/cardano/get_public_key.slip39.json b/common/tests/fixtures/cardano/get_public_key.slip39.json index 5398c3cee1..8d9bdf8060 100644 --- a/common/tests/fixtures/cardano/get_public_key.slip39.json +++ b/common/tests/fixtures/cardano/get_public_key.slip39.json @@ -1,9 +1,9 @@ { "setup": { "mnemonic": [ - "extra extend academic bishop cricket bundle tofu goat apart victim enlarge program behavior permit course armed jerky faint language modern", - "extra extend academic acne away best indicate impact square oasis prospect painting voting guest either argue username racism enemy eclipse", - "extra extend academic arcade born dive legal hush gross briefing talent drug much home firefly toxic analysis idea umbrella slice" + "extra extend academic bishop cricket bundle tofu goat apart victim enlarge program behavior permit course armed jerky faint language modern", + "extra extend academic acne away best indicate impact square oasis prospect painting voting guest either argue username racism enemy eclipse", + "extra extend academic arcade born dive legal hush gross briefing talent drug much home firefly toxic analysis idea umbrella slice" ], "passphrase": "TREZOR" }, @@ -21,7 +21,7 @@ "parameters": { "path": "m/44'/1815'/0'/0/1" }, - "result": { + "result": { "public_key": "24c4fe188a39103db88818bc191fd8571eae7b284ebcbdf2462bde97b058a95c", "chain_code": "6f7a744035f4b3ddb8f861c18446169643cc3ae85e271b4b4f0eda05cf84c65b" } @@ -30,7 +30,7 @@ "parameters": { "path": "m/44'/1815'/0'/0/2" }, - "result": { + "result": { "public_key": "831a63d381a8dab1e6e1ee991a4300fc70687aae5f97f4fcf92ed1b6c2bd99de", "chain_code": "672d6af4707aba201b7940231e83dd357f92f8851b3dfdc224ef311e1b64cdeb" } diff --git a/common/tests/fixtures/cardano/sign_tx.json b/common/tests/fixtures/cardano/sign_tx.json index b4d45dd9c8..0d6f010e75 100644 --- a/common/tests/fixtures/cardano/sign_tx.json +++ b/common/tests/fixtures/cardano/sign_tx.json @@ -1178,7 +1178,8 @@ ] } }, - {"description": "transaction with everything set except pool registration certificate", + { + "description": "transaction with everything set except pool registration certificate", "parameters": { "protocol_magic": 764824073, "network_id": 1, diff --git a/tests/device_tests/cardano/test_sign_tx.py b/tests/device_tests/cardano/test_sign_tx.py index ad05ce57b9..d2c5590f04 100644 --- a/tests/device_tests/cardano/test_sign_tx.py +++ b/tests/device_tests/cardano/test_sign_tx.py @@ -34,7 +34,7 @@ pytestmark = [ "cardano/sign_tx.slip39.json", ) def test_cardano_sign_tx(client, parameters, result): - signing_mode = cardano.SIGNING_MODE_IDS[parameters["signing_mode"]] + signing_mode = messages.CardanoTxSigningMode.__members__[parameters["signing_mode"]] inputs = [cardano.parse_input(i) for i in parameters["inputs"]] outputs = [cardano.parse_output(o) for o in parameters["outputs"]] certificates = [cardano.parse_certificate(c) for c in parameters["certificates"]] @@ -70,7 +70,7 @@ def test_cardano_sign_tx(client, parameters, result): "cardano/sign_tx.failed.json", "cardano/sign_tx_stake_pool_registration.failed.json" ) def test_cardano_sign_tx_failed(client, parameters, result): - signing_mode = cardano.SIGNING_MODE_IDS[parameters["signing_mode"]] + signing_mode = messages.CardanoTxSigningMode.__members__[parameters["signing_mode"]] inputs = [cardano.parse_input(i) for i in parameters["inputs"]] outputs = [cardano.parse_output(o) for o in parameters["outputs"]] certificates = [cardano.parse_certificate(c) for c in parameters["certificates"]]