@@ -56,11 +56,11 @@ def run_test(self):
5656 self .sync_all ()
5757 assert_array_result (self .nodes [1 ].listreceivedbyaddress (),
5858 {"address" :unblinded },
59- {"address" :unblinded , "account" :"" , "amount" :Decimal ("0.1" ), "confirmations" :10 , "txids" :[txid ,]})
59+ {"address" :unblinded , "account" :"" , "amount" :{ "bitcoin" : Decimal ("0.1" )} , "confirmations" :10 , "txids" :[txid ,]})
6060 #With min confidence < 10
6161 assert_array_result (self .nodes [1 ].listreceivedbyaddress (5 ),
6262 {"address" :unblinded },
63- {"address" :unblinded , "account" :"" , "amount" :Decimal ("0.1" ), "confirmations" :10 , "txids" :[txid ,]})
63+ {"address" :unblinded , "account" :"" , "amount" :{ "bitcoin" : Decimal ("0.1" )} , "confirmations" :10 , "txids" :[txid ,]})
6464 #With min confidence > 10, should not find Tx
6565 assert_array_result (self .nodes [1 ].listreceivedbyaddress (11 ),{"blindedaddress" :addr },{ },True )
6666
@@ -69,7 +69,7 @@ def run_test(self):
6969 unblinded = self .nodes [1 ].validateaddress (addr )['unconfidential' ]
7070 assert_array_result (self .nodes [1 ].listreceivedbyaddress (0 ,True ),
7171 {"address" :unblinded },
72- {"address" :unblinded , "account" :"" , "amount" :0 , "confirmations" :0 , "txids" :[]})
72+ {"address" :unblinded , "account" :"" , "amount" :{} , "confirmations" :0 , "txids" :[]})
7373
7474 '''
7575 getreceivedbyaddress Test
@@ -106,7 +106,7 @@ def run_test(self):
106106 received_by_account_json = get_sub_array_from_array (self .nodes [1 ].listreceivedbyaccount (),{"account" :account })
107107 if len (received_by_account_json ) == 0 :
108108 raise AssertionError ("No accounts found in node" )
109- balance_by_account = self .nodes [1 ].getreceivedbyaccount (account )
109+ balance_by_account = self .nodes [1 ].getreceivedbyaccount (account )[ "bitcoin" ]
110110
111111 txid = self .nodes [0 ].sendtoaddress (addr , 0.1 )
112112 self .sync_all ()
@@ -117,7 +117,7 @@ def run_test(self):
117117 received_by_account_json )
118118
119119 # getreceivedbyaddress should return same balance because of 0 confirmations
120- balance = self .nodes [1 ].getreceivedbyaccount (account )
120+ balance = self .nodes [1 ].getreceivedbyaccount (account )[ "bitcoin" ]
121121 if balance != balance_by_account :
122122 raise AssertionError ("Wrong balance returned by getreceivedbyaccount, %0.2f" % (balance ))
123123
@@ -126,10 +126,10 @@ def run_test(self):
126126 # listreceivedbyaccount should return updated account balance
127127 assert_array_result (self .nodes [1 ].listreceivedbyaccount (),
128128 {"account" :account },
129- {"account" :received_by_account_json ["account" ], "amount" :(received_by_account_json ["amount" ] + Decimal ("0.1" ))})
129+ {"account" :received_by_account_json ["account" ], "amount" :{ "bitcoin" : (received_by_account_json ["amount" ][ "bitcoin" ] + Decimal ("0.1" ))} })
130130
131131 # getreceivedbyaddress should return updates balance
132- balance = self .nodes [1 ].getreceivedbyaccount (account )
132+ balance = self .nodes [1 ].getreceivedbyaccount (account )[ "bitcoin" ]
133133 if balance != balance_by_account + Decimal ("0.1" ):
134134 raise AssertionError ("Wrong balance returned by getreceivedbyaccount, %0.2f" % (balance ))
135135
@@ -140,12 +140,12 @@ def run_test(self):
140140 raise AssertionError ("No accounts found in node" )
141141
142142 # Test includeempty of listreceivedbyaccount
143- if received_by_account_json ["amount" ] != Decimal ( "0.0" ) :
143+ if received_by_account_json ["amount" ] != {} :
144144 raise AssertionError ("Wrong balance returned by listreceivedbyaccount, %0.2f" % (received_by_account_json ["amount" ]))
145145
146146 # Test getreceivedbyaccount for 0 amount accounts
147147 balance = self .nodes [1 ].getreceivedbyaccount ("mynewaccount" )
148- if balance != Decimal ( "0.0" ) :
148+ if balance != {} :
149149 raise AssertionError ("Wrong balance returned by getreceivedbyaccount, %0.2f" % (balance ))
150150
151151if __name__ == '__main__' :
0 commit comments