From 8f004785af95f6d591cdf5c83ca178e1755a5e23 Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Thu, 7 Sep 2017 14:26:16 +0900 Subject: [PATCH] Update tests for COIN changes --- ...ainnet_100000.json => bitcoincash_mainnet_100000.json} | 0 tests/lib/test_addresses.py | 6 +++--- tests/server/test_compaction.py | 1 + tests/server/test_env.py | 8 +++++--- tests/wallet/test_bip32.py | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) rename tests/blocks/{bitcoin_mainnet_100000.json => bitcoincash_mainnet_100000.json} (100%) diff --git a/tests/blocks/bitcoin_mainnet_100000.json b/tests/blocks/bitcoincash_mainnet_100000.json similarity index 100% rename from tests/blocks/bitcoin_mainnet_100000.json rename to tests/blocks/bitcoincash_mainnet_100000.json diff --git a/tests/lib/test_addresses.py b/tests/lib/test_addresses.py index 1e4ecce..9fceac1 100644 --- a/tests/lib/test_addresses.py +++ b/tests/lib/test_addresses.py @@ -26,13 +26,13 @@ import pytest -from lib.coins import Litecoin, Bitcoin, Zcash +from lib.coins import Litecoin, BitcoinCash, Zcash from lib.hash import Base58 addresses = [ - (Bitcoin, "13xDKJbjh4acmLpNVr6Lc9hFcXRr9fyt4x", + (BitcoinCash, "13xDKJbjh4acmLpNVr6Lc9hFcXRr9fyt4x", "206168f5322583ff37f8e55665a4789ae8963532", "b8cb80b26e8932f5b12a7e"), - (Bitcoin, "3GxRZWkJufR5XA8hnNJgQ2gkASSheoBcmW", + (BitcoinCash, "3GxRZWkJufR5XA8hnNJgQ2gkASSheoBcmW", "a773db925b09add367dcc253c1f9bbc1d11ec6fd", "062d8515e50cb92b8a3a73"), (Litecoin, "LNBAaWuZmipg29WXfz5dtAm1pjo8FEH8yg", "206168f5322583ff37f8e55665a4789ae8963532", "b8cb80b26e8932f5b12a7e"), diff --git a/tests/server/test_compaction.py b/tests/server/test_compaction.py index d1974b5..8a7514f 100644 --- a/tests/server/test_compaction.py +++ b/tests/server/test_compaction.py @@ -115,6 +115,7 @@ def run_test(db_dir): environ.clear() environ['DB_DIRECTORY'] = db_dir environ['DAEMON_URL'] = '' + environ['COIN'] = 'BitcoinCash' env = Env() db = DB(env) # Test abstract compaction diff --git a/tests/server/test_env.py b/tests/server/test_env.py index 315ee86..5843722 100644 --- a/tests/server/test_env.py +++ b/tests/server/test_env.py @@ -15,6 +15,7 @@ BASE_DB_DIR = '/some/dir' base_environ = { 'DB_DIRECTORY': BASE_DB_DIR, 'DAEMON_URL': BASE_DAEMON_URL, + 'COIN': 'BitcoinCash', } def setup_base_env(): @@ -77,10 +78,10 @@ def test_COIN_NET(): '''Test COIN and NET defaults and redirection.''' setup_base_env() e = Env() - assert e.coin == lib_coins.Bitcoin + assert e.coin == lib_coins.BitcoinCash os.environ['NET'] = 'testnet' e = Env() - assert e.coin == lib_coins.BitcoinTestnet + assert e.coin == lib_coins.BitcoinCashTestnet os.environ.pop('NET') os.environ['COIN'] = 'Litecoin' e = Env() @@ -102,7 +103,8 @@ def test_HOST(): assert e.cs_host() == ['192.168.0.1', '23.45.67.89'] def test_REORG_LIMIT(): - assert_integer('REORG_LIMIT', 'reorg_limit', lib_coins.Bitcoin.REORG_LIMIT) + assert_integer('REORG_LIMIT', 'reorg_limit', + lib_coins.BitcoinCash.REORG_LIMIT) def test_TCP_PORT(): assert_integer('TCP_PORT', 'tcp_port', None) diff --git a/tests/wallet/test_bip32.py b/tests/wallet/test_bip32.py index db5b743..c5bd967 100644 --- a/tests/wallet/test_bip32.py +++ b/tests/wallet/test_bip32.py @@ -5,7 +5,7 @@ import pytest import wallet.bip32 as bip32 -from lib.coins import Bitcoin, CoinError +from lib.coins import BitcoinCash as Bitcoin, CoinError from lib.hash import Base58