Browse Source

Update coin names

Rename BitcoinCash to BitcoinSV
A few releases later BitcoinCashABC will be renamed BitcoinCash,
but not now to avoid an abrupt change in meaning
patch-2
Neil Booth 6 years ago
parent
commit
d48ad6cbaa
  1. 4
      README.rst
  2. 27
      electrumx/lib/coins.py
  3. 0
      tests/blocks/bitcoinsv_mainnet_100000.json
  4. 2
      tests/server/test_compaction.py
  5. 14
      tests/server/test_env.py

4
README.rst

@ -29,10 +29,10 @@ Supported Coins
- Argentum - ARG
- Bitbay - BAY
- Bitcoin - BTC
- Bitcoin Cash - BCH
- Bitcoin Cash ABC - BCHABC
- Bitcoin Gold - BTG
- Bitcoin Segwit - BTC
- Bitcoin SV - BSV
- BitcoinAtom - BCA
- BitcoinGreen - BITG
- BitcoinPlus - XBC

27
electrumx/lib/coins.py

@ -366,9 +366,9 @@ class HOdlcoin(Coin):
TX_PER_BLOCK = 5
class BitcoinCash(BitcoinMixin, Coin):
NAME = "BitcoinCash"
SHORTNAME = "BCH"
class BitcoinSV(BitcoinMixin, Coin):
NAME = "BitcoinSV"
SHORTNAME = "BSV"
TX_COUNT = 267318795
TX_COUNT_HEIGHT = 557037
TX_PER_BLOCK = 400
@ -380,8 +380,8 @@ class BitcoinCash(BitcoinMixin, Coin):
]
class BitcoinCashABC(BitcoinMixin, Coin):
NAME = "BitcoinCashABC"
class BitcoinCash(BitcoinMixin, Coin):
NAME = "BitcoinCashABC" # Some releases later remove the ABC suffix
SHORTNAME = "BCH"
TX_COUNT = 265479628
TX_COUNT_HEIGHT = 556592
@ -548,18 +548,15 @@ class BitcoinTestnetMixin(object):
PEER_DEFAULT_PORTS = {'t': '51001', 's': '51002'}
class BitcoinCashTestnet(BitcoinTestnetMixin, Coin):
'''Bitcoin Testnet for Bitcoin Cash daemons.'''
NAME = "BitcoinCash"
class BitcoinSVTestnet(BitcoinTestnetMixin, Coin):
'''Bitcoin Testnet for Bitcoin SV daemons.'''
NAME = "BitcoinSV"
PEERS = [
'electrum-testnet-abc.criptolayer.net s50112',
'bchtestnet.arihanc.com t53001 s53002',
'ciiattqkgzebpp6jofjbrkhvhwmgnsfoayljdcrve2p3qmkbv3duaoyd.onion '
't53001 s53002',
'electrontest.cascharia.com t51001 s51002',
]
class BitcoinCashRegtest(BitcoinCashTestnet):
class BitcoinSVRegtest(BitcoinSVTestnet):
NET = "regtest"
GENESIS_HASH = ('0f9188f13cb7b2c71f2a335e3a4fc328'
'bf5beb436012afca590b1a11466e2206')
@ -666,8 +663,8 @@ class LitecoinRegtest(LitecoinTestnet):
TX_COUNT_HEIGHT = 1
class BitcoinCashABCRegtest(BitcoinTestnetMixin, Coin):
NAME = "BitcoinCashABC"
class BitcoinCashRegtest(BitcoinTestnetMixin, Coin):
NAME = "BitcoinCashABC" # Some releases later remove the ABC suffix
NET = "regtest"
PEERS = []
GENESIS_HASH = ('0f9188f13cb7b2c71f2a335e3a4fc328'

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

2
tests/server/test_compaction.py

@ -113,7 +113,7 @@ async def run_test(db_dir):
environ.clear()
environ['DB_DIRECTORY'] = db_dir
environ['DAEMON_URL'] = ''
environ['COIN'] = 'BitcoinCash'
environ['COIN'] = 'BitcoinSV'
db = DB(Env())
await db.open_for_serving()
history = db.history

14
tests/server/test_env.py

@ -16,7 +16,7 @@ BASE_DB_DIR = '/some/dir'
base_environ = {
'DB_DIRECTORY': BASE_DB_DIR,
'DAEMON_URL': BASE_DAEMON_URL,
'COIN': 'BitcoinCash',
'COIN': 'BitcoinSV',
}
@ -88,13 +88,13 @@ def test_COIN_NET():
'''Test COIN and NET defaults and redirection.'''
setup_base_env()
e = Env()
assert e.coin == lib_coins.BitcoinCash
assert e.coin == lib_coins.BitcoinSV
os.environ['NET'] = 'testnet'
e = Env()
assert e.coin == lib_coins.BitcoinCashTestnet
assert e.coin == lib_coins.BitcoinSVTestnet
os.environ['NET'] = ' testnet '
e = Env()
assert e.coin == lib_coins.BitcoinCashTestnet
assert e.coin == lib_coins.BitcoinSVTestnet
os.environ.pop('NET')
os.environ['COIN'] = ' Litecoin '
e = Env()
@ -169,7 +169,7 @@ def test_RPC_HOST():
def test_REORG_LIMIT():
assert_integer('REORG_LIMIT', 'reorg_limit',
lib_coins.BitcoinCash.REORG_LIMIT)
lib_coins.BitcoinSV.REORG_LIMIT)
def test_TCP_PORT():
@ -416,5 +416,5 @@ def test_ban_versions():
def test_coin_class_provided():
e = Env(lib_coins.BitcoinCash)
assert e.coin == lib_coins.BitcoinCash
e = Env(lib_coins.BitcoinSV)
assert e.coin == lib_coins.BitcoinSV

Loading…
Cancel
Save