예제 #1
0
    def test_address_to_script(self):
        # bech32 native segwit
        # test vectors from BIP-0173
        self.assertEqual(
            address_to_script('LTC1QW508D6QEJXTDG4Y5R3ZARVARY0C5XW7KGMN4N9'),
            '0014751e76e8199196d454941c45d1b3a323f1433bd6')
        self.assertEqual(
            address_to_script(
                'ltc1pw508d6qejxtdg4y5r3zarvary0c5xw7kw508d6qejxtdg4y5r3zarvary0c5xw7k0tul4w'
            ),
            '5128751e76e8199196d454941c45d1b3a323f1433bd6751e76e8199196d454941c45d1b3a323f1433bd6'
        )
        self.assertEqual(address_to_script('LTC1SW50QZGYDF5'), '6002751e')
        self.assertEqual(
            address_to_script('ltc1zw508d6qejxtdg4y5r3zarvaryvdzur3w'),
            '5210751e76e8199196d454941c45d1b3a323')

        # base58 P2PKH
        self.assertEqual(
            address_to_script('LNuZh2Eeps3L114Lu4PVCxBR61UvqcAb8p'),
            '76a91428662c67561b95c79d2257d2a93d9d151c977e9188ac')
        self.assertEqual(
            address_to_script('LVTnwCztciF3bcZpSqvJStuMSXrnDt1pUU'),
            '76a914704f4b81cadb7bf7e68c08cd3657220f680f863c88ac')

        # base58 P2SH
        self.assertEqual(
            address_to_script('MBmyiC29MUQSfPC2gKtdrazbSWHvGqJCnU'),
            'a9142a84cf00d47f699ee7bbc1dea5ec1bdecb4ac15487')
        self.assertEqual(
            address_to_script('MWBtJBTgiEWYQ7m17wFktku2dvSFZXqhWZ'),
            'a914f47c8954e421031ad04ecd8e7752c9479206b9d387')
예제 #2
0
    def test_address_to_script(self):
        # bech32 native segwit
        # test vectors from BIP-0173
        self.assertEqual(
            address_to_script('BC1QW508D6QEJXTDG4Y5R3ZARVARY0C5XW7KV8F3T4'),
            '0014751e76e8199196d454941c45d1b3a323f1433bd6')
        self.assertEqual(
            address_to_script(
                'bc1pw508d6qejxtdg4y5r3zarvary0c5xw7kw508d6qejxtdg4y5r3zarvary0c5xw7k7grplx'
            ),
            '5128751e76e8199196d454941c45d1b3a323f1433bd6751e76e8199196d454941c45d1b3a323f1433bd6'
        )
        self.assertEqual(address_to_script('BC1SW50QA3JX3S'), '6002751e')
        self.assertEqual(
            address_to_script('bc1zw508d6qejxtdg4y5r3zarvaryvg6kdaj'),
            '5210751e76e8199196d454941c45d1b3a323')

        # base58 P2PKH
        self.assertEqual(
            address_to_script('14gcRovpkCoGkCNBivQBvw7eso7eiNAbxG'),
            '76a91428662c67561b95c79d2257d2a93d9d151c977e9188ac')
        self.assertEqual(
            address_to_script('1BEqfzh4Y3zzLosfGhw1AsqbEKVW6e1qHv'),
            '76a914704f4b81cadb7bf7e68c08cd3657220f680f863c88ac')

        # base58 P2SH
        self.assertEqual(
            address_to_script('35ZqQJcBQMZ1rsv8aSuJ2wkC7ohUCQMJbT'),
            'a9142a84cf00d47f699ee7bbc1dea5ec1bdecb4ac15487')
        self.assertEqual(
            address_to_script('3PyjzJ3im7f7bcV724GR57edKDqoZvH7Ji'),
            'a914f47c8954e421031ad04ecd8e7752c9479206b9d387')
예제 #3
0
    def test_address_to_script(self):
        # base58 P2PKH
        self.assertEqual(
            address_to_script('XJtSNWxWufU5XAh59JfXPx9peodJwTqPqf'),
            '76a91452af650fba3ebae076e81e3475045c1733e1933d88ac')
        self.assertEqual(
            address_to_script('XMy7W6qnXjKQzjKCD4JpkNBccMXwqQdGjn'),
            '76a914747a19c67e086c3426821cd4bfd011e44e5a8e8788ac')

        # base58 P2SH
        self.assertEqual(
            address_to_script('8WHUEVtMDLeereT5r4ZoNKjr3MXr4gqfon'),
            'a914a6bc1aa409ab5f2e895aa28f3cadb30dc623728e87')
        self.assertEqual(
            address_to_script('8WhNpVKta6kkbP24HfvvQVeHEmgBQYiJCB'),
            'a914ab41915b8462a3a12e1d7a2b8fd84c06ddeb9dfb87')
예제 #4
0
    def test_address_to_script(self):
        # base58 P2PKH
        self.assertEqual(
            address_to_script('XeNTG4aihv1ru8xmaoiQnToSi8hLiTTNbh'),
            '76a91428662c67561b95c79d2257d2a93d9d151c977e9188ac')
        self.assertEqual(
            address_to_script('XkvgWFLxVmDaVkUF8bFE2QXP4f5C2KKWEg'),
            '76a914704f4b81cadb7bf7e68c08cd3657220f680f863c88ac')

        # base58 P2SH
        self.assertEqual(
            address_to_script('7WHUEVtMDLeereT5r4ZoNKjr3MXr4gqfon'),
            'a9142a84cf00d47f699ee7bbc1dea5ec1bdecb4ac15487')
        self.assertEqual(
            address_to_script('7phNpVKta6kkbP24HfvvQVeHEmgBQYiJCB'),
            'a914f47c8954e421031ad04ecd8e7752c9479206b9d387')
예제 #5
0
    def test_address_to_script(self):
        # base58 P2PKH
        self.assertEqual(
            address_to_script('PBenpocD6pDoAoFZP4qA2pLpNwrm6FAcVw'),
            '76a9142197669050d01c6136181127ac8a0c631733da9688ac')
        self.assertEqual(
            address_to_script('P9h6zCz253jmc4TvqgKPRNpkx5qELdNWWT'),
            '76a9140c1724583577182cceef0e31bc176b2dcfdaadfd88ac')

        # base58 P2SH
        self.assertEqual(
            address_to_script('7WHUEVtMDLeereT5r4ZoNKjr3MXr4gqfon'),
            'a9142a84cf00d47f699ee7bbc1dea5ec1bdecb4ac15487')
        self.assertEqual(
            address_to_script('7phNpVKta6kkbP24HfvvQVeHEmgBQYiJCB'),
            'a914f47c8954e421031ad04ecd8e7752c9479206b9d387')
예제 #6
0
    def test_address_to_script(self):
        # base58 P2PKH
        self.assertEqual(
            address_to_script('mutXcGt1CJdkRvXuN2xoz2quAAQYQ59bRX'),
            '76a9149da64e300c5e4eb4aaffc9c2fd465348d5618ad488ac')
        self.assertEqual(
            address_to_script('miqtaRTkU3U8rzwKbEHx3g8FSz8GJtPS3K'),
            '76a914247d2d5b6334bdfa2038e85b20fc15264f8e5d2788ac')

        # base58 P2SH
        self.assertEqual(
            address_to_script('2N3LSvr3hv5EVdfcrxg2Yzecf3SRvqyBE4p'),
            'a9146eae23d8c4a941316017946fc761a7a6c85561fb87')
        self.assertEqual(
            address_to_script('2NE4ZdmxFmUgwu5wtfoN2gVniyMgRDYq1kk'),
            'a914e4567743d378957cd2ee7072da74b1203c1a7a0b87')
예제 #7
0
    def test_address_to_script(self):
        # base58 P2PKH
        self.assertEqual(
            address_to_script('14gcRovpkCoGkCNBivQBvw7eso7eiNAbxG'),
            '76a91428662c67561b95c79d2257d2a93d9d151c977e9188ac')
        self.assertEqual(
            address_to_script('1BEqfzh4Y3zzLosfGhw1AsqbEKVW6e1qHv'),
            '76a914704f4b81cadb7bf7e68c08cd3657220f680f863c88ac')

        # base58 P2SH
        self.assertEqual(
            address_to_script('35ZqQJcBQMZ1rsv8aSuJ2wkC7ohUCQMJbT'),
            'a9142a84cf00d47f699ee7bbc1dea5ec1bdecb4ac15487')
        self.assertEqual(
            address_to_script('3PyjzJ3im7f7bcV724GR57edKDqoZvH7Ji'),
            'a914f47c8954e421031ad04ecd8e7752c9479206b9d387')
예제 #8
0
    def test_address_to_script(self):
        # base58 P2PKH
        self.assertEqual(
            address_to_script('RCxoWKp7M2bqpCjPC6PK2TSre4aFPUZWp6'),
            '76a91428662c67561b95c79d2257d2a93d9d151c977e9188ac')
        self.assertEqual(
            address_to_script('RKX2kWaM8soZQpErjsv8GQAnzax6k5BgWU'),
            '76a914704f4b81cadb7bf7e68c08cd3657220f680f863c88ac')

        # base58 P2SH
        self.assertEqual(
            address_to_script('bGc6AzTECnd7HZ54Y1YnpyX8UAJw4EBkue'),
            'a9142a84cf00d47f699ee7bbc1dea5ec1bdecb4ac15487')
        self.assertEqual(
            address_to_script('bb1zkytmZYjD2He2ycuus9RZfaTGSa17zf'),
            'a914f47c8954e421031ad04ecd8e7752c9479206b9d387')
예제 #9
0
    def test_address_to_script(self):
        # base58 P2PKH
        self.assertEqual(
            address_to_script('tmQ5vePhZkGVbPhJdFd7J9bQF9p5jmVXGe5'),
            '76a9149da64e300c5e4eb4aaffc9c2fd465348d5618ad488ac')
        self.assertEqual(
            address_to_script('tmD3HcYHK21Kypmi3UpSSDEgbSdoTcnduow'),
            '76a914247d2d5b6334bdfa2038e85b20fc15264f8e5d2788ac')

        # base58 P2SH
        self.assertEqual(
            address_to_script('t2Ge2v7dx9Q87aDcx9iDr48uxCEe1gBVzCT'),
            'a9146eae23d8c4a941316017946fc761a7a6c85561fb87')
        self.assertEqual(
            address_to_script('t2TN9d3YVzoaZqdwyrqZKjz6289tW3JF78v'),
            'a914e4567743d378957cd2ee7072da74b1203c1a7a0b87')
예제 #10
0
    def test_address_to_script(self):
        # base58 P2PKH
        self.assertEqual(
            address_to_script('t1MZDS9LxiXasLqR5fMDK4kDa8TJjSFsMsq'),
            '76a91428662c67561b95c79d2257d2a93d9d151c977e9188ac')
        self.assertEqual(
            address_to_script('t1U7SgL7CWNnawSvZD8k8JgwWUygasy2cp1'),
            '76a914704f4b81cadb7bf7e68c08cd3657220f680f863c88ac')

        # base58 P2SH
        self.assertEqual(
            address_to_script('t3NSSQe2KNgLcTWy2WsiRAkr7NTtZ15fhLn'),
            'a9142a84cf00d47f699ee7bbc1dea5ec1bdecb4ac15487')
        self.assertEqual(
            address_to_script('t3grLzdTrjSSiCFXzxV5YCvkYZt2tJjDLau'),
            'a914f47c8954e421031ad04ecd8e7752c9479206b9d387')
예제 #11
0
    def test_address_to_script(self):
        # base58 P2PKH
        self.assertEqual(
            address_to_script('yah2ARXMnY5A9VaR5Cd43fjiQnsu2vZ5a8'),
            '76a9149da64e300c5e4eb4aaffc9c2fd465348d5618ad488ac')
        self.assertEqual(
            address_to_script('yPeP8a774GuYaZyqJPxC7K24hcbcsqz1Au'),
            '76a914247d2d5b6334bdfa2038e85b20fc15264f8e5d2788ac')

        # base58 P2SH
        self.assertEqual(
            address_to_script('8pWgedHiF9DQswwXdR59ATSQe9pxyBZqbv'),
            'a9146eae23d8c4a941316017946fc761a7a6c85561fb87')
        self.assertEqual(
            address_to_script('91EoMZCG6Yfs9NGZLYQcrJcUa55TLnvVxz'),
            'a914e4567743d378957cd2ee7072da74b1203c1a7a0b87')
예제 #12
0
    def test_address_to_script(self):
        # base58 P2PKH
        self.assertEqual(
            address_to_script('GYastr1RxW8Pjcn1Y8jQCZd65wcGVAf8Xb'),
            '76a914a1b18ac00db95bcc53b9fdf1dbaa97f1fe7e305588ac')
        self.assertEqual(
            address_to_script('GWJCHdaZFn8Jz14n6nbE5f7kcBTR7LDDcX'),
            '76a91488999299c6164054793522f5b8a0d312f3e5d27288ac')

        # base58 P2SH
        self.assertEqual(
            address_to_script('bVFFc3ivKkH53swKo76aS8qggzFkrA5Ty6'),
            'a914b52d95009d90c4485dddde8317bf31b035c5131c87')
        self.assertEqual(
            address_to_script('bGTSofKbsw1AtZWQAS3VMGM4mk1biTiZ9n'),
            'a91428e249b28416bf909d7b52537b4f8785c9fb505b87')
예제 #13
0
    def test_address_to_script(self):
        # bech32 native segwit
        # test vectors from BIP-0173 TODO
        self.assertEqual(
            address_to_script('STAK1Q4KPN6PSTHGD5UR894AUHJJ2G02WLGMP8KE08NE'),
            '0014ad833d060bba1b4e0ce5af797949487a9df46c27')
        print("\n" + address_to_script(
            'stak1qp8f842ywwr9h5rdxyzggex7q3trvvvaarfssxccju52rj6htfzfsqr79j2')
              )
        self.assertEqual(
            address_to_script(
                'stak1qp8f842ywwr9h5rdxyzggex7q3trvvvaarfssxccju52rj6htfzfsqr79j2'
            ),
            '002009d27aa88e70cb7a0da620908c9bc08ac6c633bd1a61036312e514396aeb4893'
        )

        # base58 P2PKH
        self.assertEqual(
            address_to_script('MFMy9FwJsV6HiN5eZDqDETw4pw52q3UGrb'),
            '76a91451dadacc7021440cbe4ca148a5db563b329b4c0388ac')
        self.assertEqual(
            address_to_script('MVELZC3ks1Xk59kvKWuSN3mpByNwaxeaBJ'),
            '76a914e9fb298e72e29ebc2b89864a5e4ae10e0b84726088ac')

        # base58 P2SH
        self.assertEqual(
            address_to_script('PHjTKtgYLTJ9D2Bzw2f6xBB41KBm2HeGfg'),
            'a9146449f568c9cd2378138f2636e1567112a184a9e887')
        self.assertEqual(
            address_to_script('3AqJ6Tn8qS8LKMDfi41AhuZiY6JbR6mt6E'),
            'a9146449f568c9cd2378138f2636e1567112a184a9e887')
예제 #14
0
    def test_address_to_script(self):
        # bech32 native segwit
        # test vectors from BIP-0173
        self.assertEqual(
            address_to_script(
                'tvia1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qc2d56j'
            ),
            '00201863143c14c5166804bd19203356da136c985678cd4d27a1b8c6329604903262'
        )
        self.assertEqual(
            address_to_script(
                'tvia1qqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvses5u96mg'
            ),
            '0020000000c4a5cad46221b2a187905e5266362b99d5e91c6ce24d165dab93e86433'
        )

        # base58 P2PKH
        self.assertEqual(
            address_to_script('tMJBN1ecZC3mWrmHkkHuk3CVEEXdnTx2xX'),
            '76a9149da64e300c5e4eb4aaffc9c2fd465348d5618ad488ac')
        self.assertEqual(
            address_to_script('tAFYLAEMpvt9wwAhywd3ogUqX4FMbXcDM9'),
            '76a914247d2d5b6334bdfa2038e85b20fc15264f8e5d2788ac')

        # base58 P2SH
        self.assertEqual(
            address_to_script('2N3LSvr3hv5EVdfcrxg2Yzecf3SRvqyBE4p'),
            'a9146eae23d8c4a941316017946fc761a7a6c85561fb87')
        self.assertEqual(
            address_to_script('2NE4ZdmxFmUgwu5wtfoN2gVniyMgRDYq1kk'),
            'a914e4567743d378957cd2ee7072da74b1203c1a7a0b87')
예제 #15
0
    def test_address_to_script(self):
        # bech32 native segwit
        # test vectors from BIP-0173
        self.assertEqual(
            address_to_script(
                'tdongri1qfj8lu0rafk2mpvk7jj62q8eerjpex3xlcadtupkrkhh5a73htmhs68e55m'
            ),
            '00204c8ffe3c7d4d95b0b2de94b4a01f391c839344dfc75abe06c3b5ef4efa375eef'
        )
        self.assertEqual(
            address_to_script(
                'tdongri1q0p29rfu7ap3duzqj5t9e0jzgqzwdtd97pa5rhuz4r38t5a6dknyqxmyyaz'
            ),
            '0020785451a79ee862de0812a2cb97c848009cd5b4be0f683bf0551c4eba774db4c8'
        )

        # base58 P2PKH
        self.assertEqual(
            address_to_script('mptvgSbAs4iwxQ7JQZdEN6Urpt3dtjbawd'),
            '76a91466e0ef980c8ff8129e8d0f716b2ce1df2f97bbbf88ac')
        self.assertEqual(
            address_to_script('mrodaP7iH3B9ZXSptfGQXLKE3hfdjMdf7y'),
            '76a9147bd0d45ec256701811ebb38cfd2ba3d17576bf3e88ac')

        # base58 P2SH
        self.assertEqual(
            address_to_script('pJwLxfRRUhAaYJsKzKCk9cATAn8Do2SS7L'),
            'a91492e825fa92f4aa873c6caf4b20f6c7e949b456a987')
        self.assertEqual(
            address_to_script('pHNnBm6ECsh5QsUyXMzdoAXV8qV68wj2M4'),
            'a91481c75a711f23443b44d70b10ddf856e39a6b254d87')
예제 #16
0
    def test_address_to_script(self):
        # bech32 native segwit
        # test vectors from BIP-0173
        self.assertEqual(
            address_to_script(
                'tltc1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qsnr4fp'
            ),
            '00201863143c14c5166804bd19203356da136c985678cd4d27a1b8c6329604903262'
        )
        self.assertEqual(
            address_to_script(
                'tltc1qqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvsesu9tmgm'
            ),
            '0020000000c4a5cad46221b2a187905e5266362b99d5e91c6ce24d165dab93e86433'
        )

        # base58 P2PKH
        self.assertEqual(
            address_to_script('mutXcGt1CJdkRvXuN2xoz2quAAQYQ59bRX'),
            '76a9149da64e300c5e4eb4aaffc9c2fd465348d5618ad488ac')
        self.assertEqual(
            address_to_script('miqtaRTkU3U8rzwKbEHx3g8FSz8GJtPS3K'),
            '76a914247d2d5b6334bdfa2038e85b20fc15264f8e5d2788ac')

        # base58 P2SH
        self.assertEqual(
            address_to_script('QWhD3ruwwBHamrNuan4a5M46BpskgXmWih'),
            'a9146eae23d8c4a941316017946fc761a7a6c85561fb87')
        self.assertEqual(
            address_to_script('QhRKknpVnak33GhwHuQ3mCEA7k8F4zxDXG'),
            'a914e4567743d378957cd2ee7072da74b1203c1a7a0b87')
예제 #17
0
    def test_address_to_script(self):
        # bech32 native segwit
        # test vectors from BIP-0173
        self.assertEqual(
            address_to_script(
                'tb1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3q0sl5k7'
            ),
            '00201863143c14c5166804bd19203356da136c985678cd4d27a1b8c6329604903262'
        )
        self.assertEqual(
            address_to_script(
                'tb1qqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvsesrxh6hy'
            ),
            '0020000000c4a5cad46221b2a187905e5266362b99d5e91c6ce24d165dab93e86433'
        )

        # base58 P2PKH
        self.assertEqual(
            address_to_script('mutXcGt1CJdkRvXuN2xoz2quAAQYQ59bRX'),
            '76a9149da64e300c5e4eb4aaffc9c2fd465348d5618ad488ac')
        self.assertEqual(
            address_to_script('miqtaRTkU3U8rzwKbEHx3g8FSz8GJtPS3K'),
            '76a914247d2d5b6334bdfa2038e85b20fc15264f8e5d2788ac')

        # base58 P2SH
        self.assertEqual(
            address_to_script('2N3LSvr3hv5EVdfcrxg2Yzecf3SRvqyBE4p'),
            'a9146eae23d8c4a941316017946fc761a7a6c85561fb87')
        self.assertEqual(
            address_to_script('2NE4ZdmxFmUgwu5wtfoN2gVniyMgRDYq1kk'),
            'a914e4567743d378957cd2ee7072da74b1203c1a7a0b87')
예제 #18
0
    def test_address_to_script(self):
        # bech32 native segwit
        # test vectors from BIP-0173
        self.assertEqual(address_to_script('BC1QW508D6QEJXTDG4Y5R3ZARVARY0C5XW7KV8F3T4'), '0014751e76e8199196d454941c45d1b3a323f1433bd6')
        self.assertEqual(address_to_script('bc1pw508d6qejxtdg4y5r3zarvary0c5xw7kw508d6qejxtdg4y5r3zarvary0c5xw7k7grplx'), '5128751e76e8199196d454941c45d1b3a323f1433bd6751e76e8199196d454941c45d1b3a323f1433bd6')
        self.assertEqual(address_to_script('BC1SW50QA3JX3S'), '6002751e')
        self.assertEqual(address_to_script('bc1zw508d6qejxtdg4y5r3zarvaryvg6kdaj'), '5210751e76e8199196d454941c45d1b3a323')

        # base58 P2PKH
        self.assertEqual(address_to_script('14gcRovpkCoGkCNBivQBvw7eso7eiNAbxG'), '76a91428662c67561b95c79d2257d2a93d9d151c977e9188ac')
        self.assertEqual(address_to_script('1BEqfzh4Y3zzLosfGhw1AsqbEKVW6e1qHv'), '76a914704f4b81cadb7bf7e68c08cd3657220f680f863c88ac')

        # base58 P2SH
        self.assertEqual(address_to_script('35ZqQJcBQMZ1rsv8aSuJ2wkC7ohUCQMJbT'), 'a9142a84cf00d47f699ee7bbc1dea5ec1bdecb4ac15487')
        self.assertEqual(address_to_script('3PyjzJ3im7f7bcV724GR57edKDqoZvH7Ji'), 'a914f47c8954e421031ad04ecd8e7752c9479206b9d387')
예제 #19
0
    def test_address_to_script(self):
        # bech32 native segwit
        # test vectors from BIP-0173
        self.assertEqual(address_to_script('tb1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3q0sl5k7'), '00201863143c14c5166804bd19203356da136c985678cd4d27a1b8c6329604903262')
        self.assertEqual(address_to_script('tb1qqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvsesrxh6hy'), '0020000000c4a5cad46221b2a187905e5266362b99d5e91c6ce24d165dab93e86433')

        # base58 P2PKH
        self.assertEqual(address_to_script('mutXcGt1CJdkRvXuN2xoz2quAAQYQ59bRX'), '76a9149da64e300c5e4eb4aaffc9c2fd465348d5618ad488ac')
        self.assertEqual(address_to_script('miqtaRTkU3U8rzwKbEHx3g8FSz8GJtPS3K'), '76a914247d2d5b6334bdfa2038e85b20fc15264f8e5d2788ac')

        # base58 P2SH
        self.assertEqual(address_to_script('2N3LSvr3hv5EVdfcrxg2Yzecf3SRvqyBE4p'), 'a9146eae23d8c4a941316017946fc761a7a6c85561fb87')
        self.assertEqual(address_to_script('2NE4ZdmxFmUgwu5wtfoN2gVniyMgRDYq1kk'), 'a914e4567743d378957cd2ee7072da74b1203c1a7a0b87')