Browse Source

Fix groestlcoin address parsing

Baesd on erasmospunk's PR #551
patch-2
Neil Booth 7 years ago
parent
commit
e5b2268387
  1. 10
      electrumx/lib/coins.py
  2. 2
      tests/lib/test_addresses.py

10
electrumx/lib/coins.py

@ -2062,11 +2062,17 @@ class Groestlcoin(Coin):
'xkj42efxrcy6vbfw.onion t', 'xkj42efxrcy6vbfw.onion t',
] ]
def grshash(data):
import groestlcoin_hash
return groestlcoin_hash.getHash(data, len(data))
@classmethod @classmethod
def header_hash(cls, header): def header_hash(cls, header):
'''Given a header return the hash.''' '''Given a header return the hash.'''
import groestlcoin_hash return cls.grshash(header)
return groestlcoin_hash.getHash(header, len(header))
ENCODE_CHECK = partial(Base58.encode_check, hash_fn=grshash)
DECODE_CHECK = partial(Base58.decode_check, hash_fn=grshash)
class GroestlcoinTestnet(Groestlcoin): class GroestlcoinTestnet(Groestlcoin):

2
tests/lib/test_addresses.py

@ -51,6 +51,8 @@ addresses = [
"2789d58cfa0957d206f025c2af056fc8a77cebb0", "8cc9b11122272bd7b79a50"), "2789d58cfa0957d206f025c2af056fc8a77cebb0", "8cc9b11122272bd7b79a50"),
(coins.Decred, "DcuQKx8BES9wU7C6Q5VmLBjw436r27hayjS", (coins.Decred, "DcuQKx8BES9wU7C6Q5VmLBjw436r27hayjS",
"f0b4e85100aee1a996f22915eb3c3f764d53779a", "a03c1a27de9ac3b3122e8d"), "f0b4e85100aee1a996f22915eb3c3f764d53779a", "a03c1a27de9ac3b3122e8d"),
(coins.Groestlcoin, "FY7vmDL7FZGACwqVNx5p4fVaGghojWM5AF",
"206168f5322583ff37f8e55665a4789ae8963532", "b8cb80b26e8932f5b12a7e"),
] ]

Loading…
Cancel
Save