def test_decode_bip84(self): prv = 'zprvAWgYBBk7JR8Gjrh4UJQ2uJdG1r3WNRRfURiABBE3RvMXYSrRJL62XuezvGdPvG6GFBZduosCc1YP5wixPox7zhZLfiUm8aunE96BBa4Kei5' m = Xprv.decode(prv) self.assertEqual(m.type, ADDRESS.P2WPKH) self.assertTrue(m.is_master()) xprv = Xprv.decode('zprvAg4yBxbZcJpcLxtXp5kZuh8jC1FXGtZnCjrkG69JPf96KZ1TqSakA1HF3EZkNjt9yC4CTjm7txs4sRD9EoHLgDqwhUE6s1yD9nY4BCNN4hw') xpub = Xpub.decode('zpub6u4KbU8TSgNuZSxzv7HaGq5Tk361gMHdZxnM4UYuwzg5CMLcNytzhobitV4Zq6vWtWHpG9QijsigkxAzXvQWyLRfLq1L7VxPP1tky1hPfD4') self.assertEqual(xprv.to_xpub(), xpub) self.assertEqual(xprv.path, "m/x/x/x/0") self.assertEqual(xpub.path, "M/x/x/x/0")
def test_decode_bip49(self): prv = 'yprvABrGsX5C9jantZVwdwcQhDXkqsu4RoSAZKBwPnLA3uyeVM3C3fvTuqzru4fovMSLqYSqALGe9MBqCf7Pg7Y7CTsjoNnLYg6HxR2Xo44NX7E' m = Xprv.decode(prv) self.assertEqual(m.type, ADDRESS.P2WPKH_P2SH) self.assertTrue(m.is_master()) xprv = Xprv.decode('yprvAKoaYbtSYB8DmmBt2Z7TgukWphdCiSMRVdzDK3aHUSna8jo6xnG41jQ11ToPk4SQnE5sau6CYK4od9fyz53mK7huW4JskyMMEmixACuyhhr') xpub = Xpub.decode('ypub6Ynvx7RLNYgWzFGM8aeU43hFNjTh7u5Grrup7Ryu2nKZ1Y8FWKaJZXiUrkJSnMmGVNBoVH1DNDtQ32tR4YFDRSpSUXjjvsiMnCvoPHVWXJP') self.assertEqual(xprv.to_xpub(), xpub) self.assertEqual(xprv.path, "m/x/x/x/0") self.assertEqual(xpub.path, "M/x/x/x/0")