@@ -23,17 +23,24 @@ def run_test(self):
23
23
pubk2 = self .nodes [0 ].getaddressinfo (addr_LEGACY )['pubkey' ]
24
24
addr_BECH32 = self .nodes [0 ].getnewaddress ("" , "bech32" )
25
25
pubk3 = self .nodes [0 ].getaddressinfo (addr_BECH32 )['pubkey' ]
26
- self .nodes [0 ].sendtoaddress (addr_P2SH_SEGWIT , 1 )
27
- self .nodes [0 ].sendtoaddress (addr_LEGACY , 2 )
28
- self .nodes [0 ].sendtoaddress (addr_BECH32 , 3 )
26
+ self .nodes [0 ].sendtoaddress (addr_P2SH_SEGWIT , 0.001 )
27
+ self .nodes [0 ].sendtoaddress (addr_LEGACY , 0.002 )
28
+ self .nodes [0 ].sendtoaddress (addr_BECH32 , 0.004 )
29
29
30
30
#send to child keys of tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK
31
- self .nodes [0 ].sendtoaddress ("mkHV1C6JLheLoUSSZYk7x3FH5tnx9bu7yc" , 1 ) # (m/0'/0'/0')
32
- self .nodes [0 ].sendtoaddress ("mipUSRmJAj2KrjSvsPQtnP8ynUon7FhpCR" , 2 ) # (m/0'/0'/1')
33
- self .nodes [0 ].sendtoaddress ("n37dAGe6Mq1HGM9t4b6rFEEsDGq7Fcgfqg" , 3 ) # (m/0'/0'/1500')
34
- self .nodes [0 ].sendtoaddress ("mqS9Rpg8nNLAzxFExsgFLCnzHBsoQ3PRM6" , 4 ) # (m/0'/0'/0)
35
- self .nodes [0 ].sendtoaddress ("mnTg5gVWr3rbhHaKjJv7EEEc76ZqHgSj4S" , 5 ) # (m/0'/0'/1)
36
- self .nodes [0 ].sendtoaddress ("mketCd6B9U9Uee1iCsppDJJBHfvi6U6ukC" , 6 ) # (m/0'/0'/1500)
31
+ self .nodes [0 ].sendtoaddress ("mkHV1C6JLheLoUSSZYk7x3FH5tnx9bu7yc" , 0.008 ) # (m/0'/0'/0')
32
+ self .nodes [0 ].sendtoaddress ("mipUSRmJAj2KrjSvsPQtnP8ynUon7FhpCR" , 0.016 ) # (m/0'/0'/1')
33
+ self .nodes [0 ].sendtoaddress ("n37dAGe6Mq1HGM9t4b6rFEEsDGq7Fcgfqg" , 0.032 ) # (m/0'/0'/1500')
34
+ self .nodes [0 ].sendtoaddress ("mqS9Rpg8nNLAzxFExsgFLCnzHBsoQ3PRM6" , 0.064 ) # (m/0'/0'/0)
35
+ self .nodes [0 ].sendtoaddress ("mnTg5gVWr3rbhHaKjJv7EEEc76ZqHgSj4S" , 0.128 ) # (m/0'/0'/1)
36
+ self .nodes [0 ].sendtoaddress ("mketCd6B9U9Uee1iCsppDJJBHfvi6U6ukC" , 0.256 ) # (m/0'/0'/1500)
37
+ self .nodes [0 ].sendtoaddress ("mj8zFzrbBcdaWXowCQ1oPZ4qioBVzLzAp7" , 0.512 ) # (m/1/1/0')
38
+ self .nodes [0 ].sendtoaddress ("mfnKpKQEftniaoE1iXuMMePQU3PUpcNisA" , 1.024 ) # (m/1/1/1')
39
+ self .nodes [0 ].sendtoaddress ("mou6cB1kaP1nNJM1sryW6YRwnd4shTbXYQ" , 2.048 ) # (m/1/1/1500')
40
+ self .nodes [0 ].sendtoaddress ("mtfUoUax9L4tzXARpw1oTGxWyoogp52KhJ" , 4.096 ) # (m/1/1/0)
41
+ self .nodes [0 ].sendtoaddress ("mxp7w7j8S1Aq6L8StS2PqVvtt4HGxXEvdy" , 8.192 ) # (m/1/1/1)
42
+ self .nodes [0 ].sendtoaddress ("mpQ8rokAhp1TAtJQR6F6TaUmjAWkAWYYBq" , 16.384 ) # (m/1/1/1500)
43
+
37
44
38
45
self .nodes [0 ].generate (1 )
39
46
@@ -45,17 +52,39 @@ def run_test(self):
45
52
46
53
self .restart_node (0 , ['-nowallet' ])
47
54
self .log .info ("Test if we have found the non HD unspent outputs." )
48
- assert_equal (self .nodes [0 ].scantxoutset ("start" , [ "combo(" + pubk1 + ")" , "combo(" + pubk2 + ")" , "combo(" + pubk3 + ")" ])['total_amount' ], 6 )
49
- assert_equal (self .nodes [0 ].scantxoutset ("start" , [ "addr(" + addr_P2SH_SEGWIT + ")" , "addr(" + addr_LEGACY + ")" , "addr(" + addr_BECH32 + ")" ])['total_amount' ], 6 )
50
- assert_equal (self .nodes [0 ].scantxoutset ("start" , [ "addr(" + addr_P2SH_SEGWIT + ")" , "addr(" + addr_LEGACY + ")" , "combo(" + pubk3 + ")" ])['total_amount' ], 6 )
55
+ assert_equal (self .nodes [0 ].scantxoutset ("start" , [ "pkh(" + pubk1 + ")" , "pkh(" + pubk2 + ")" , "pkh(" + pubk3 + ")" ])['total_amount' ], Decimal ("0.002" ))
56
+ assert_equal (self .nodes [0 ].scantxoutset ("start" , [ "wpkh(" + pubk1 + ")" , "wpkh(" + pubk2 + ")" , "wpkh(" + pubk3 + ")" ])['total_amount' ], Decimal ("0.004" ))
57
+ assert_equal (self .nodes [0 ].scantxoutset ("start" , [ "sh(wpkh(" + pubk1 + "))" , "sh(wpkh(" + pubk2 + "))" , "sh(wpkh(" + pubk3 + "))" ])['total_amount' ], Decimal ("0.001" ))
58
+ assert_equal (self .nodes [0 ].scantxoutset ("start" , [ "combo(" + pubk1 + ")" , "combo(" + pubk2 + ")" , "combo(" + pubk3 + ")" ])['total_amount' ], Decimal ("0.007" ))
59
+ assert_equal (self .nodes [0 ].scantxoutset ("start" , [ "addr(" + addr_P2SH_SEGWIT + ")" , "addr(" + addr_LEGACY + ")" , "addr(" + addr_BECH32 + ")" ])['total_amount' ], Decimal ("0.007" ))
60
+ assert_equal (self .nodes [0 ].scantxoutset ("start" , [ "addr(" + addr_P2SH_SEGWIT + ")" , "addr(" + addr_LEGACY + ")" , "combo(" + pubk3 + ")" ])['total_amount' ], Decimal ("0.007" ))
51
61
52
62
self .log .info ("Test extended key derivation." )
53
- assert_equal (self .nodes [0 ].scantxoutset ("start" , [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0'/0'/0')" ])['total_amount' ], 1 )
54
- assert_equal (self .nodes [0 ].scantxoutset ("start" , [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0'/0'/1')" ])['total_amount' ], 2 )
55
- assert_equal (self .nodes [0 ].scantxoutset ("start" , [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0'/0'/*')" ])['total_amount' ], 3 )
56
- assert_equal (self .nodes [0 ].scantxoutset ("start" , [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0'/0'/0)" ])['total_amount' ], 4 )
57
- assert_equal (self .nodes [0 ].scantxoutset ("start" , [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0'/0'/1)" ])['total_amount' ], 5 )
58
- assert_equal (self .nodes [0 ].scantxoutset ("start" , [ {"desc" : "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0'/0'/*')" , "range" : 1501 }])['total_amount' ], 6 )
63
+ assert_equal (self .nodes [0 ].scantxoutset ("start" , [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0'/0'/0')" ])['total_amount' ], Decimal ("0.008" ))
64
+ assert_equal (self .nodes [0 ].scantxoutset ("start" , [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0'/0'/1')" ])['total_amount' ], Decimal ("0.016" ))
65
+ assert_equal (self .nodes [0 ].scantxoutset ("start" , [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0'/0'/1500')" ])['total_amount' ], Decimal ("0.032" ))
66
+ assert_equal (self .nodes [0 ].scantxoutset ("start" , [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0'/0'/0)" ])['total_amount' ], Decimal ("0.064" ))
67
+ assert_equal (self .nodes [0 ].scantxoutset ("start" , [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0'/0'/1)" ])['total_amount' ], Decimal ("0.128" ))
68
+ assert_equal (self .nodes [0 ].scantxoutset ("start" , [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0'/0'/1500)" ])['total_amount' ], Decimal ("0.256" ))
69
+ assert_equal (self .nodes [0 ].scantxoutset ("start" , [ {"desc" : "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0'/0'/*')" , "range" : 1499 }])['total_amount' ], Decimal ("0.024" ))
70
+ assert_equal (self .nodes [0 ].scantxoutset ("start" , [ {"desc" : "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0'/0'/*')" , "range" : 1500 }])['total_amount' ], Decimal ("0.056" ))
71
+ assert_equal (self .nodes [0 ].scantxoutset ("start" , [ {"desc" : "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0'/0'/*)" , "range" : 1499 }])['total_amount' ], Decimal ("0.192" ))
72
+ assert_equal (self .nodes [0 ].scantxoutset ("start" , [ {"desc" : "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0'/0'/*)" , "range" : 1500 }])['total_amount' ], Decimal ("0.448" ))
73
+ assert_equal (self .nodes [0 ].scantxoutset ("start" , [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/0')" ])['total_amount' ], Decimal ("0.512" ))
74
+ assert_equal (self .nodes [0 ].scantxoutset ("start" , [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/1')" ])['total_amount' ], Decimal ("1.024" ))
75
+ assert_equal (self .nodes [0 ].scantxoutset ("start" , [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/1500')" ])['total_amount' ], Decimal ("2.048" ))
76
+ assert_equal (self .nodes [0 ].scantxoutset ("start" , [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/0)" ])['total_amount' ], Decimal ("4.096" ))
77
+ assert_equal (self .nodes [0 ].scantxoutset ("start" , [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/1)" ])['total_amount' ], Decimal ("8.192" ))
78
+ assert_equal (self .nodes [0 ].scantxoutset ("start" , [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/1500)" ])['total_amount' ], Decimal ("16.384" ))
79
+ assert_equal (self .nodes [0 ].scantxoutset ("start" , [ "combo(tpubD6NzVbkrYhZ4WaWSyoBvQwbpLkojyoTZPRsgXELWz3Popb3qkjcJyJUGLnL4qHHoQvao8ESaAstxYSnhyswJ76uZPStJRJCTKvosUCJZL5B/1/1/0)" ])['total_amount' ], Decimal ("4.096" ))
80
+ assert_equal (self .nodes [0 ].scantxoutset ("start" , [ "combo(tpubD6NzVbkrYhZ4WaWSyoBvQwbpLkojyoTZPRsgXELWz3Popb3qkjcJyJUGLnL4qHHoQvao8ESaAstxYSnhyswJ76uZPStJRJCTKvosUCJZL5B/1/1/1)" ])['total_amount' ], Decimal ("8.192" ))
81
+ assert_equal (self .nodes [0 ].scantxoutset ("start" , [ "combo(tpubD6NzVbkrYhZ4WaWSyoBvQwbpLkojyoTZPRsgXELWz3Popb3qkjcJyJUGLnL4qHHoQvao8ESaAstxYSnhyswJ76uZPStJRJCTKvosUCJZL5B/1/1/1500)" ])['total_amount' ], Decimal ("16.384" ))
82
+ assert_equal (self .nodes [0 ].scantxoutset ("start" , [ {"desc" : "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/*')" , "range" : 1499 }])['total_amount' ], Decimal ("1.536" ))
83
+ assert_equal (self .nodes [0 ].scantxoutset ("start" , [ {"desc" : "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/*')" , "range" : 1500 }])['total_amount' ], Decimal ("3.584" ))
84
+ assert_equal (self .nodes [0 ].scantxoutset ("start" , [ {"desc" : "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/*)" , "range" : 1499 }])['total_amount' ], Decimal ("12.288" ))
85
+ assert_equal (self .nodes [0 ].scantxoutset ("start" , [ {"desc" : "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/*)" , "range" : 1500 }])['total_amount' ], Decimal ("28.672" ))
86
+ assert_equal (self .nodes [0 ].scantxoutset ("start" , [ {"desc" : "combo(tpubD6NzVbkrYhZ4WaWSyoBvQwbpLkojyoTZPRsgXELWz3Popb3qkjcJyJUGLnL4qHHoQvao8ESaAstxYSnhyswJ76uZPStJRJCTKvosUCJZL5B/1/1/*)" , "range" : 1499 }])['total_amount' ], Decimal ("12.288" ))
87
+ assert_equal (self .nodes [0 ].scantxoutset ("start" , [ {"desc" : "combo(tpubD6NzVbkrYhZ4WaWSyoBvQwbpLkojyoTZPRsgXELWz3Popb3qkjcJyJUGLnL4qHHoQvao8ESaAstxYSnhyswJ76uZPStJRJCTKvosUCJZL5B/1/1/*)" , "range" : 1500 }])['total_amount' ], Decimal ("28.672" ))
59
88
60
89
if __name__ == '__main__' :
61
90
ScantxoutsetTest ().main ()
0 commit comments