Ejemplo n.º 1
0
 def test_addresses(self):
     entropy = "3123213213213123312c3kjifj3"
     private_key = "7a6be1df9cc5d88edce5443ef0fce246123295dd82afae9a57986543272157cc"
     wif = "L1KgWtY57mSggocxDVSDRGvLVCRYuQfj8ur7cHvuv6UkgJmXweti"
     public_key = "021ad7138370ef5e93fb243aff3373e2b92383818dfc20022841b655e0cd6c618c"
     uncompressed_public_key = "041ad7138370ef5e93fb243aff3373e2b92383818dfc20022841b655e0cd6c618cd578261c78e1adfe205c3ade8b81e1722d6058be9155eee55468fbb04b62040e"
     qtum_address = "QLonXSbmVhECBV3fqN3L7H9LJn8jUS3m9k"
     q = Qtum("3123213213213123312c3kjifj3")
     self.assertEqual(q.get_private_key(), private_key)
     self.assertEqual(q.get_wif(), wif)
     self.assertEqual(q.get_public_key(), public_key)
     self.assertEqual(q.get_uncompressed_public_key(),
                      uncompressed_public_key)
     self.assertEqual(q.get_qtum_address(), qtum_address)
     self.assertEqual(q.private_key_to_wif(private_key), wif)
     self.assertEqual(q.wif_to_private_key(wif), private_key)
Ejemplo n.º 2
0
    def test_init_from_wif(self):
        private_key = '5907a2e9e917fbb8ab93a4d309184d1fe2cd55030f1e616620ef794e6a5b0df5'
        public_key = '0356fd892d76117935853466db2bf0ac5d0eb9138bfa78c3b25d68f1b64f9a5106'
        uncompressed_public_key = '0456fd892d76117935853466db2bf0ac5d0eb9138bfa78c3b25d68f1b64f9a51068a6b2f8b4c80c32f6e898d06b765c3a95a2eb372dcbbf2d086bce89b4f256dcb'
        wif = 'cQZmGLJZAMpNY36YFKbH6gygW2eBDULpokkeTYdPg41fo4BqycEc'
        qtum_address = 'qgNj57RLaEsLQUpD5JZxZ6tREonrfp5z2i'
        hex_address = 'fa46f119b82df651edb8a7bff2172dccc7cfac9a'

        q = Qtum({'wif': wif}, mainnet=False)

        self.assertEqual(q.get_public_key(), public_key)
        self.assertEqual(q.get_uncompressed_public_key(),
                         uncompressed_public_key)
        self.assertEqual(q.get_qtum_address(), qtum_address)
        self.assertEqual(q.get_hex_address(), hex_address)
        self.assertEqual(q.get_wif(), wif)
        self.assertEqual(q.get_private_key(), private_key)
Ejemplo n.º 3
0
    def test_valid_address(self):
        wif = 'cQZmGLJZAMpNY36YFKbH6gygW2eBDULpokkeTYdPg41fo4BqycEc'
        q = Qtum({'wif': wif}, mainnet=False)

        self.assertTrue(Qtum.verify_address(q.get_qtum_address()))