def setUp(self): self.orig = hashutils.hmac_sha512 self.orig3 = ecutils.combine_pubkeys seed = b'5636fa7760cca11a5ef1212c56fe0f5e576004e371b88a53780994ece7b6fe8f6923bd5ba3ab0688b0dbb865dbfef37894a39bf2ce9b11315c5413d510a1eee1' seed_buffer = unhexlify(seed) self.hdnode_from_seed = HDNode.from_seed(seed_buffer, BITCOIN_MAINNET) self.hdnode_from_base58 = HDNode.from_base58("xprv9s21ZrQH143K2KoRMrztFLQfsKWMADqGKYXSoPRpLapf13Q4cMcFWJeNangQ2XRucXfkoQscg4dk7w3vtfStFZNM1z4DnxfRh4XYJkT1gAg")
def test_constructor_invalid_fingerprint(self): privkey_hexa = "4ccbf2a1c6ee9a5106cb19c6be343947701a4e4acb2c4311f5"\ "a10836109711a1" number = int(privkey_hexa, 16) ecpair = ECPair(number) with self.assertRaises(ValueError): HDNode(ecpair, chaincode=b'\x1a\xbe\xc1YTQ\xa3\xe7\xb5\xfet' b'\xad5)\x06\x99\x81x,R\xd7L\x1e$\x10' b'\xc4\xf5\x1e\xa2\x08oO', depth=0, index=0, parent_fingerprint=123)
def setUp(self): seed = '4b381541583be4423346c643850da4b320e46a87ae3d2a4e6da11eba819cd4acba45d239319ac14f863b8d5ab5a0d0c64d2e8a1e7d1457df2e5a3c51c73235be' seed_buffer = unhexlify(seed) self.node = HDNode.from_seed(seed_buffer, BITCOIN_MAINNET)
def setUp(self): seed = 'fffcf9f6f3f0edeae7e4e1dedbd8d5d2cfccc9c6c3c0bdbab7b4b1aeaba8a5a29f9c999693908d8a8784817e7b7875726f6c696663605d5a5754514e4b484542' seed_buffer = unhexlify(seed) self.node = HDNode.from_seed(seed_buffer, BITCOIN_MAINNET)
def setUp(self): seed = '000102030405060708090a0b0c0d0e0f' seed_buffer = unhexlify(seed) self.node = HDNode.from_seed(seed_buffer, BITCOIN_MAINNET)
def test_from_base58_invalid_arg(self): with self.assertRaises(ValueError): self.hdnode_from_base58 = HDNode.from_base58("5FQT7TdYBPPpYJVsyfmdBw2e9wf8GtJnMToZf7Pun6LH5EAaa8KkQXGQQFygE2qWAdYzRiD7GPf8n1BmPGPVshLUazWMoacKhwaXH87u11ZfwM9TG")
def test_abc(self): with self.assertRaises(ValueError): HDNode.from_base58("4Q1JnNwEpCghKERZ8esUgQxtMpncJ5YUBJx75PGQ2nCJNGXGVEN1Me6KJ6zaXcczxWSg9DmyzLxXFkXSSwMSPY4WL4sDAer2Cifdhum6LCsHjRxm")
def test_creation_xpub(self): hdnode = HDNode.from_base58("xpub6DF8uhdarytz3FWdA8TvFSvvAh8dP3283MY7p2V4SeE2wyWmG5mg5EwVvmdMVCQcoNJxGoWaU9DCWh89LojfZ537wTfunKau47EL2dhHKon") self.assertIsInstance(hdnode, HDNode)