Browse Source

Update tests for COIN changes

master
Neil Booth 7 years ago
parent
commit
8f004785af
  1. 0
      tests/blocks/bitcoincash_mainnet_100000.json
  2. 6
      tests/lib/test_addresses.py
  3. 1
      tests/server/test_compaction.py
  4. 8
      tests/server/test_env.py
  5. 2
      tests/wallet/test_bip32.py

0
tests/blocks/bitcoin_mainnet_100000.json → tests/blocks/bitcoincash_mainnet_100000.json

6
tests/lib/test_addresses.py

@ -26,13 +26,13 @@
import pytest import pytest
from lib.coins import Litecoin, Bitcoin, Zcash from lib.coins import Litecoin, BitcoinCash, Zcash
from lib.hash import Base58 from lib.hash import Base58
addresses = [ addresses = [
(Bitcoin, "13xDKJbjh4acmLpNVr6Lc9hFcXRr9fyt4x", (BitcoinCash, "13xDKJbjh4acmLpNVr6Lc9hFcXRr9fyt4x",
"206168f5322583ff37f8e55665a4789ae8963532", "b8cb80b26e8932f5b12a7e"), "206168f5322583ff37f8e55665a4789ae8963532", "b8cb80b26e8932f5b12a7e"),
(Bitcoin, "3GxRZWkJufR5XA8hnNJgQ2gkASSheoBcmW", (BitcoinCash, "3GxRZWkJufR5XA8hnNJgQ2gkASSheoBcmW",
"a773db925b09add367dcc253c1f9bbc1d11ec6fd", "062d8515e50cb92b8a3a73"), "a773db925b09add367dcc253c1f9bbc1d11ec6fd", "062d8515e50cb92b8a3a73"),
(Litecoin, "LNBAaWuZmipg29WXfz5dtAm1pjo8FEH8yg", (Litecoin, "LNBAaWuZmipg29WXfz5dtAm1pjo8FEH8yg",
"206168f5322583ff37f8e55665a4789ae8963532", "b8cb80b26e8932f5b12a7e"), "206168f5322583ff37f8e55665a4789ae8963532", "b8cb80b26e8932f5b12a7e"),

1
tests/server/test_compaction.py

@ -115,6 +115,7 @@ def run_test(db_dir):
environ.clear() environ.clear()
environ['DB_DIRECTORY'] = db_dir environ['DB_DIRECTORY'] = db_dir
environ['DAEMON_URL'] = '' environ['DAEMON_URL'] = ''
environ['COIN'] = 'BitcoinCash'
env = Env() env = Env()
db = DB(env) db = DB(env)
# Test abstract compaction # Test abstract compaction

8
tests/server/test_env.py

@ -15,6 +15,7 @@ BASE_DB_DIR = '/some/dir'
base_environ = { base_environ = {
'DB_DIRECTORY': BASE_DB_DIR, 'DB_DIRECTORY': BASE_DB_DIR,
'DAEMON_URL': BASE_DAEMON_URL, 'DAEMON_URL': BASE_DAEMON_URL,
'COIN': 'BitcoinCash',
} }
def setup_base_env(): def setup_base_env():
@ -77,10 +78,10 @@ def test_COIN_NET():
'''Test COIN and NET defaults and redirection.''' '''Test COIN and NET defaults and redirection.'''
setup_base_env() setup_base_env()
e = Env() e = Env()
assert e.coin == lib_coins.Bitcoin assert e.coin == lib_coins.BitcoinCash
os.environ['NET'] = 'testnet' os.environ['NET'] = 'testnet'
e = Env() e = Env()
assert e.coin == lib_coins.BitcoinTestnet assert e.coin == lib_coins.BitcoinCashTestnet
os.environ.pop('NET') os.environ.pop('NET')
os.environ['COIN'] = 'Litecoin' os.environ['COIN'] = 'Litecoin'
e = Env() e = Env()
@ -102,7 +103,8 @@ def test_HOST():
assert e.cs_host() == ['192.168.0.1', '23.45.67.89'] assert e.cs_host() == ['192.168.0.1', '23.45.67.89']
def test_REORG_LIMIT(): 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(): def test_TCP_PORT():
assert_integer('TCP_PORT', 'tcp_port', None) assert_integer('TCP_PORT', 'tcp_port', None)

2
tests/wallet/test_bip32.py

@ -5,7 +5,7 @@
import pytest import pytest
import wallet.bip32 as bip32 import wallet.bip32 as bip32
from lib.coins import Bitcoin, CoinError from lib.coins import BitcoinCash as Bitcoin, CoinError
from lib.hash import Base58 from lib.hash import Base58

Loading…
Cancel
Save