diff --git a/.cirrus.yml b/.cirrus.yml index 47c02b06..4f2538a1 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -32,6 +32,7 @@ unittests_task: - pip install git+https://github.com/bitcoinplusorg/x13-hash - pip install xevan_hash - pip install quark_hash + - pip install algomodule - pip install groestlcoin_hash - pip install x16r_hash - pip install pycryptodomex diff --git a/electrumx/lib/coins.py b/electrumx/lib/coins.py index ef25c74c..bbf31225 100644 --- a/electrumx/lib/coins.py +++ b/electrumx/lib/coins.py @@ -50,7 +50,7 @@ import electrumx.server.daemon as daemon from electrumx.server.session import (ElectrumX, DashElectrumX, SmartCashElectrumX, AuxPoWElectrumX, - NameIndexElectrumX, NameIndexAuxPoWElectrumX) + NameIndexElectrumX, NameIndexAuxPoWElectrumX, HemisElectrumX) @dataclass @@ -4239,3 +4239,80 @@ class FerriteTestnet(Ferrite): 'enode2.ferritecoin.org s t', 'enode3.ferritecoin.org s t', ] + + +class Hemis(Coin): + NAME = "Hemis" + SHORTNAME = "HMS" + NET = "mainnet" + XPUB_VERBYTES = bytes.fromhex("A0F2F5F3") + XPRV_VERBYTES = bytes.fromhex("A0F3F1FB") + GENESIS_HASH = '000000956c582b70df5d2c9b4b83d05b5331978e40d639739bdc96c29e156ce7' + P2PKH_VERBYTE = bytes.fromhex("28") + P2SH_VERBYTE = bytes.fromhex("0D") + WIF_BYTE = bytes.fromhex("D4") + DESERIALIZER = lib_tx.DeserializerPIVX + TX_COUNT_HEIGHT = 569399 + TX_COUNT = 2157510 + TX_PER_BLOCK = 1 + STATIC_BLOCK_HEADERS = False + RPC_PORT = 51473 + REORG_LIMIT = 100 + EXPANDED_HEADER = 112 + SAPLING_START_HEIGHT = 502 + BLOCK_VERSION = 11 + SESSIONCLS = HemisElectrumX + + @classmethod + def static_header_len(cls, height): + '''Given a header height return its length.''' + if height <= 499: + return cls.BASIC_HEADER_SIZE + elif height == 500: + return cls.EXPANDED_HEADER + elif height == 501: + return cls.BASIC_HEADER_SIZE + else: + return cls.EXPANDED_HEADER + + @classmethod + def header_hash(cls, header): + '''Given a header return the hash.''' + version, = struct.unpack('