bdk-ffi/bdk-python/tests/test_offline_descriptor.py

19 lines
802 B
Python
Raw Normal View History

2023-10-27 14:13:44 -04:00
import bdkpython as bdk
import unittest
class OfflineDescriptorTest(unittest.TestCase):
2023-10-27 14:13:44 -04:00
def test_descriptor_bip86(self):
mnemonic: bdk.Mnemonic = bdk.Mnemonic.from_string("space echo position wrist orient erupt relief museum myself grain wisdom tumble")
descriptor_secret_key: bdk.DescriptorSecretKey = bdk.DescriptorSecretKey(bdk.Network.TESTNET, mnemonic, None)
descriptor: bdk.Descriptor = bdk.Descriptor.new_bip86(descriptor_secret_key, bdk.KeychainKind.EXTERNAL, bdk.Network.TESTNET)
self.assertEqual(
"tr([be1eec8f/86'/1'/0']tpubDCTtszwSxPx3tATqDrsSyqScPNnUChwQAVAkanuDUCJQESGBbkt68nXXKRDifYSDbeMa2Xg2euKbXaU3YphvGWftDE7ozRKPriT6vAo3xsc/0/*)#m7puekcx",
2024-06-12 20:08:14 -05:00
descriptor.__str__()
2023-10-27 14:13:44 -04:00
)
if __name__ == '__main__':
unittest.main()