From b31092a8744b6924b74a348cf271c860cdbdd787 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Wed, 22 May 2019 16:46:49 +0200 Subject: [PATCH] core/tests: don't use coins.by_shortcut --- core/tests/test_apps.common.coins.py | 9 +++------ core/tests/test_apps.wallet.address.py | 10 +++++----- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/core/tests/test_apps.common.coins.py b/core/tests/test_apps.common.coins.py index 7b95db0e04..dc12979755 100644 --- a/core/tests/test_apps.common.coins.py +++ b/core/tests/test_apps.common.coins.py @@ -15,14 +15,11 @@ class TestCoins(unittest.TestCase): ('TAZ', 'Zcash Testnet', 7461), ] for s, n, a in ref: - c1 = coins.by_shortcut(s) - c2 = coins.by_name(n) - self.assertEqual(c1, c2) - self.assertEqual(c1.address_type, a) + c = coins.by_name(n) + self.assertEqual(c.address_type, a) + self.assertEqual(c.coin_shortcut, s) def test_failure(self): - with self.assertRaises(ValueError): - coins.by_shortcut('XXX') with self.assertRaises(ValueError): coins.by_name('XXXXX') diff --git a/core/tests/test_apps.wallet.address.py b/core/tests/test_apps.wallet.address.py index 11b5e83dcf..f51c2b6628 100644 --- a/core/tests/test_apps.wallet.address.py +++ b/core/tests/test_apps.wallet.address.py @@ -154,7 +154,7 @@ class TestAddress(unittest.TestCase): ([84 | HARDENED, 0 | HARDENED, 5 | HARDENED, 0, 10], InputScriptType.SPENDWITNESS), ([48 | HARDENED, 0 | HARDENED, 5 | HARDENED, 0, 10], InputScriptType.SPENDMULTISIG), ] - coin = coins.by_shortcut('BTC') + coin = coins.by_name('Bitcoin') for path, input_type in incorrect_derivation_paths: self.assertFalse(validate_full_path(path, coin, input_type)) @@ -190,7 +190,7 @@ class TestAddress(unittest.TestCase): ([48 | HARDENED, 145 | HARDENED, 5 | HARDENED, 0, 0], InputScriptType.SPENDMULTISIG), ([48 | HARDENED, 145 | HARDENED, 5 | HARDENED, 0, 10], InputScriptType.SPENDMULTISIG), ] - coin = coins.by_shortcut('BCH') # segwit is disabled + coin = coins.by_name('Bcash') # segwit is disabled for path, input_type in incorrect_derivation_paths: self.assertFalse(validate_full_path(path, coin, input_type)) @@ -207,7 +207,7 @@ class TestAddress(unittest.TestCase): ([44 | HARDENED, 3 | HARDENED, 0 | HARDENED, 0, 1123], InputScriptType.SPENDADDRESS), ([44 | HARDENED, 3 | HARDENED, 0 | HARDENED, 1, 44444], InputScriptType.SPENDADDRESS), ] - coin = coins.by_shortcut('DOGE') # segwit is disabled + coin = coins.by_name('Dogecoin') # segwit is disabled for path, input_type in correct_derivation_paths: self.assertTrue(validate_full_path(path, coin, input_type)) @@ -233,7 +233,7 @@ class TestAddress(unittest.TestCase): [84 | HARDENED, 0 | HARDENED, 5 | HARDENED, 0, 0], [84 | HARDENED, 0 | HARDENED, 5 | HARDENED, 0, 10], ] - coin = coins.by_shortcut('BTC') + coin = coins.by_name('Bitcoin') for path in correct_derivation_paths: self.assertTrue(validate_path_for_bitcoin_public_key(path, coin)) @@ -249,7 +249,7 @@ class TestAddress(unittest.TestCase): [44 | HARDENED, 3 | HARDENED, 0 | HARDENED, 0], [44 | HARDENED, 3 | HARDENED, 0 | HARDENED, 0, 0], ] - coin = coins.by_shortcut('DOGE') # segwit is disabled + coin = coins.by_name('Dogecoin') # segwit is disabled for path in correct_derivation_paths: self.assertTrue(validate_path_for_bitcoin_public_key(path, coin))