Add support for Decred Testnet (#580)

* Add decred Testnet support
This commit is contained in:
FABIANO S CUNHA 2018-08-17 05:15:38 -04:00 committed by Neil
parent 6dd7049339
commit 60d4ae52f7
5 changed files with 75 additions and 1 deletions

View File

@ -1667,6 +1667,25 @@ class Decred(Coin):
return h
class DecredTestnet(Decred):
SHORTNAME = "tDCR"
NET = "testnet"
XPUB_VERBYTES = bytes.fromhex("043587d1")
XPRV_VERBYTES = bytes.fromhex("04358397")
P2PKH_VERBYTE = bytes.fromhex("0f21")
P2SH_VERBYTES = [bytes.fromhex("0efc")]
WIF_BYTE = bytes.fromhex("22de")
GENESIS_HASH = (
'4261602a9d07d80ad47621a64ba6a07754902e496777edc4ff581946bd7bc29c')
BASIC_HEADER_SIZE = 180
ALLOW_ADVANCING_ERRORS = True
TX_COUNT = 217380620
TX_COUNT_HEIGHT = 464000
TX_PER_BLOCK = 1800
REORG_LIMIT = 1000
RPC_PORT = 19109
class Axe(Dash):
NAME = "Axe"
SHORTNAME = "AXE"

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -113,6 +113,13 @@ def test_COIN_NET():
e = Env()
assert e.coin == lib_coins.BitcoinGoldRegtest
os.environ.pop('NET')
os.environ['COIN'] = ' Decred '
e = Env()
assert e.coin == lib_coins.Decred
os.environ['NET'] = 'testnet'
e = Env()
assert e.coin == lib_coins.DecredTestnet
os.environ.pop('NET')
os.environ['COIN'] = ' BitcoinGreen '
e = Env()
assert e.coin == lib_coins.Bitg

View File

@ -69,7 +69,8 @@ def test_block(block_details):
assert block_info['nonce'] == h['nonce']
assert block_info['bits'] == pack_be_uint32(h['bits']).hex()
assert coin.header_hash(block.header) == hex_str_to_hash(block_info['hash'])
assert coin.header_hash(
block.header) == hex_str_to_hash(block_info['hash'])
assert (coin.header_prevhash(block.header)
== hex_str_to_hash(block_info['previousblockhash']))
for n, (tx, txid) in enumerate(block.transactions):