def test_bip49(self):
    mnemonic = 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about'
    password = b''
    path = 'm'
    hd_private_key = HDPrivateKey.from_mnemonic(mnemonic, password, path=path, testnet=True)
    want = 'EXAMPLE_KEY'
    self.assertEqual(hd_private_key.xprv(), want)
    account0 = hd_private_key.child(((1 << 31) + 49)).child(((1 << 31) + 1)).child((1 << 31))
    want = 'EXAMPLE_KEY'
    self.assertEqual(account0.xprv(), want)
    account0_pub = account0.pub
    account0_first_key = account0.child(0).child(0)
    pub_first_key = account0_pub.traverse('/0/0')
    want = 'EXAMPLE_KEY'
    self.assertEqual(account0_first_key.wif(), want)
    want = 91250063207079080279316243343576637961983659794666757541434329984523082164200
    self.assertEqual(account0_first_key.private_key.secret, want)
    want = bytes.fromhex('EXAMPLE_KEY')
    self.assertEqual(account0_first_key.private_key.point.sec(), want)
    self.assertEqual(pub_first_key.address(), account0_first_key.address())
def test_bip49(self):
    mnemonic = 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about'
    password = b
    path = 'm'
    hd_private_key = HDPrivateKey.from_mnemonic(mnemonic, password, path=path, testnet=True)
    want = 'EXAMPLE_KEY'
    self.assertEqual(hd_private_key.xprv(), want)
    account0 = hd_private_key.child(((1 << 31) + 49)).child(((1 << 31) + 1)).child((1 << 31))
    want = 'EXAMPLE_KEY'
    self.assertEqual(account0.xprv(), want)
    account0_pub = account0.pub
    account0_first_key = account0.child(0).child(0)
    pub_first_key = account0_pub.traverse('/0/0')
    want = 'EXAMPLE_KEY'
    self.assertEqual(account0_first_key.wif(), want)
    want = 91250063207079080279316243343576637961983659794666757541434329984523082164200
    self.assertEqual(account0_first_key.private_key.secret, want)
    want = bytes.fromhex('EXAMPLE_KEY')
    self.assertEqual(account0_first_key.private_key.point.sec(), want)
    self.assertEqual(pub_first_key.address(), account0_first_key.address())