Browse Source

add AXE support (#429)

patch-2
-k 7 years ago
committed by Neil
parent
commit
a1802b436b
  1. 1
      .travis.yml
  2. 37
      lib/coins.py
  3. 14
      tests/blocks/axe_mainnet_30237.json

1
.travis.yml

@ -22,6 +22,7 @@ install:
- pip install pytest-cov
- pip install pylru
- pip install blake256
- pip install x11_hash
# command to run tests
script: pytest --cov=server --cov=lib --cov=wallet
# Dont report coverage from nightly

37
lib/coins.py

@ -576,7 +576,7 @@ class BitcoinCashTestnet(BitcoinTestnetMixin, Coin):
PEERS = [
'electrum-testnet-abc.criptolayer.net s50112',
'bchtestnet.arihanc.com t53001 s53002',
'ciiattqkgzebpp6jofjbrkhvhwmgnsfoayljdcrve2p3qmkbv3duaoyd.onion t53001 s53002',
'ciiattqkgzebpp6jofjbrkhvhwmgnsfoayljdcrve2p3qmkbv3duaoyd.onion t53001 s53002',
]
@ -590,7 +590,7 @@ class BitcoinSegwitTestnet(BitcoinTestnetMixin, Coin):
'testnet.hsmiths.com t53011 s53012',
'hsmithsxurybd7uh.onion t53011 s53012',
'testnetnode.arihanc.com s t',
'w3e2orjpiiv2qwem3dw66d7c4krink4nhttngkylglpqe5r22n6n5wid.onion s t',
'w3e2orjpiiv2qwem3dw66d7c4krink4nhttngkylglpqe5r22n6n5wid.onion s t',
]
@ -1528,7 +1528,7 @@ class Decred(Coin):
if height > 0:
return super().block(raw_block, height)
else:
return Block(raw_block, cls.block_header(raw_block, height), [])
return Block(raw_block, cls.block_header(raw_block, height), [])
class DecredTestnet(Decred):
@ -1544,4 +1544,33 @@ class DecredTestnet(Decred):
TX_COUNT_HEIGHT = 254198
TX_PER_BLOCK = 1000
RPC_PORT = 19109
class Axe(Dash):
NAME = "Axe"
SHORTNAME = "AXE"
NET = "mainnet"
XPUB_VERBYTES = bytes.fromhex("02fe52cc")
XPRV_VERBYTES = bytes.fromhex("02fe52f8")
P2PKH_VERBYTE = bytes.fromhex("37")
P2SH_VERBYTES = [bytes.fromhex("10")]
WIF_BYTE = bytes.fromhex("cc")
GENESIS_HASH = ('00000c33631ca6f2f61368991ce2dc03'
'306b5bb50bf7cede5cfbba6db38e52e6')
DAEMON = daemon.DashDaemon
TX_COUNT = 18405
TX_COUNT_HEIGHT = 30237
TX_PER_BLOCK = 1
RPC_PORT = 9337
REORG_LIMIT = 1000
PEERS = []
@classmethod
def header_hash(cls, header):
'''
Given a header return the hash for AXE.
Need to download `axe_hash` module
Source code: https://github.com/AXErunners/axe_hash
'''
import x11_hash
return x11_hash.getPoWHash(header)

14
tests/blocks/axe_mainnet_30237.json

@ -0,0 +1,14 @@
{
"hash": "000000000013ae459f3755ac98e6dd01ad8364849cd1bcb1ca4a40f81a7ead75",
"size": 223,
"height": 30237,
"merkleroot": "de4266afc54356d351c11050a01165adc0e6b339268efdf1c578374b4212a266",
"tx": [
"de4266afc54356d351c11050a01165adc0e6b339268efdf1c578374b4212a266"
],
"time": 1521830841,
"nonce": 1653639604,
"bits": "1b29c9b1",
"previousblockhash": "000000000014fce86cc81f0ad3135fb139764183a645d08b582a251b023f62e9",
"block": "00000020e9623f021b252a588bd045a683417639b15f13d30a1fc86ce8fc14000000000066a212424b3778c5f1fd8e2639b3e6c0ad6511a05010c151d35643c5af6642deb94bb55ab1c9291bb48990620101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff17021d7604b94bb55a0881000001140000007969696d7000000000000200c2eb0b000000001976a914b4237f3423d7fadad0a5a4a8fd6f6bae250d59dd88ac0008af2f000000001976a914f8bc2102e0917b9537babbbaa6e15fe57307062488ac00000000"
}
Loading…
Cancel
Save