@@ -83,7 +83,7 @@ def run_test(self):
8383 self .log .info ("Good. Not accepted in the mempool." )
8484
8585 # Fixed fee
86- fee = 1
86+ fee = 0.05
8787
8888 # Node 0 shields some funds
8989 # taddr -> Sapling
@@ -209,11 +209,11 @@ def run_test(self):
209209 self .sync_all ()
210210
211211 # Verify balance
212- assert_equal (self .nodes [0 ].getshieldbalance (saplingAddr0 ), Decimal ('3 ' )) # 30 received - (20 sent + 3 fee) - 4 sent
213- assert_equal (self .nodes [1 ].getshieldbalance (saplingAddr1 ), Decimal ('20' )) # 20 received
214- assert_equal (self .nodes [0 ].getshieldbalance (saplingAddr2 ), Decimal ('2 ' )) # 10 received - 10 sent + 2 change
212+ assert_equal (self .nodes [0 ].getshieldbalance (saplingAddr0 ), Decimal ('4.9 ' )) # 30 received - (20 sent + 0.15 fee) - 4.95 sent
213+ assert_equal (self .nodes [1 ].getshieldbalance (saplingAddr1 ), Decimal ('20' )) # 20 received
214+ assert_equal (self .nodes [0 ].getshieldbalance (saplingAddr2 ), Decimal ('3.9 ' )) # 10 received - 10 sent + 3.9 change
215215 assert_equal (self .nodes [1 ].getreceivedbyaddress (taddr1 ), Decimal ('0' ))
216- assert_equal (self .nodes [0 ].getshieldbalance (), Decimal ('5 ' ))
216+ assert_equal (self .nodes [0 ].getshieldbalance (), Decimal ('8.8 ' ))
217217 self .log .info ("Balances check out" )
218218
219219 # Node 1 sends some shield funds to node 0, as well as unshielding
@@ -230,14 +230,14 @@ def run_test(self):
230230 self .sync_all ()
231231
232232 # Verify balance
233- assert_equal (self .nodes [0 ].getshieldbalance (saplingAddr0 ), Decimal ('11 ' )) # 3 prev balance + 8 received
234- assert_equal (self .nodes [1 ].getshieldbalance (saplingAddr1 ), Decimal ('1' )) # 20 prev balance - (18 sent + 1 fee)
233+ assert_equal (self .nodes [0 ].getshieldbalance (saplingAddr0 ), Decimal ('12.9 ' )) # 4.9 prev balance + 8 received
234+ assert_equal (self .nodes [1 ].getshieldbalance (saplingAddr1 ), Decimal ('1.95 ' )) # 20 prev balance - (18 sent + 0.05 fee)
235235 assert_equal (self .nodes [1 ].getreceivedbyaddress (taddr1 ), Decimal ('10' ))
236236 self .log .info ("Balances check out" )
237237
238238 # Verify existence of Sapling related JSON fields
239239 resp = self .nodes [0 ].getrawtransaction (mytxid7 , 1 )
240- assert_equal (Decimal (resp ['valueBalance' ]), Decimal ('11.00 ' )) # 20 shield input - 8 shield spend - 1 change
240+ assert_equal (Decimal (resp ['valueBalance' ]), Decimal ('10.05 ' )) # 20 shield input - 8 shield spend - 1.95 change
241241 assert_equal (len (resp ['vShieldSpend' ]), 3 )
242242 assert_equal (len (resp ['vShieldOutput' ]), 2 )
243243 assert ('bindingSig' in resp )
@@ -262,26 +262,26 @@ def run_test(self):
262262 sk0 = self .nodes [0 ].exportsaplingkey (saplingAddr0 )
263263 saplingAddrInfo0 = self .nodes [2 ].importsaplingkey (sk0 , "yes" )
264264 assert_equal (saplingAddrInfo0 ["address" ], saplingAddr0 )
265- assert_equal (self .nodes [2 ].getshieldbalance (saplingAddrInfo0 ["address" ]), Decimal ('11 ' ))
265+ assert_equal (self .nodes [2 ].getshieldbalance (saplingAddrInfo0 ["address" ]), Decimal ('12.9 ' ))
266266 sk1 = self .nodes [1 ].exportsaplingkey (saplingAddr1 )
267267 saplingAddrInfo1 = self .nodes [2 ].importsaplingkey (sk1 , "yes" )
268268 assert_equal (saplingAddrInfo1 ["address" ], saplingAddr1 )
269- assert_equal (self .nodes [2 ].getshieldbalance (saplingAddrInfo1 ["address" ]), Decimal ('1' ))
269+ assert_equal (self .nodes [2 ].getshieldbalance (saplingAddrInfo1 ["address" ]), Decimal ('1.95 ' ))
270270
271271 # Verify importing a viewing key will update the nullifiers and witnesses correctly
272272 self .log .info ("Checking exporting/importing a viewing key..." )
273273 extfvk0 = self .nodes [0 ].exportsaplingviewingkey (saplingAddr0 )
274274 saplingAddrInfo0 = self .nodes [3 ].importsaplingviewingkey (extfvk0 , "yes" )
275275 assert_equal (saplingAddrInfo0 ["address" ], saplingAddr0 )
276- assert_equal (Decimal (self .nodes [3 ].getshieldbalance (saplingAddrInfo0 ["address" ], 1 , True )), Decimal ('11 ' ))
276+ assert_equal (Decimal (self .nodes [3 ].getshieldbalance (saplingAddrInfo0 ["address" ], 1 , True )), Decimal ('12.9 ' ))
277277 extfvk1 = self .nodes [1 ].exportsaplingviewingkey (saplingAddr1 )
278278 saplingAddrInfo1 = self .nodes [3 ].importsaplingviewingkey (extfvk1 , "yes" )
279279 assert_equal (saplingAddrInfo1 ["address" ], saplingAddr1 )
280- assert_equal (self .nodes [3 ].getshieldbalance (saplingAddrInfo1 ["address" ], 1 , True ), Decimal ('1' ))
280+ assert_equal (self .nodes [3 ].getshieldbalance (saplingAddrInfo1 ["address" ], 1 , True ), Decimal ('1.95 ' ))
281281 # no balance in the wallet
282282 assert_equal (self .nodes [3 ].getshieldbalance (), Decimal ('0' ))
283283 # watch only balance
284- assert_equal (self .nodes [3 ].getshieldbalance ("*" , 1 , True ), Decimal ('12.00 ' ))
284+ assert_equal (self .nodes [3 ].getshieldbalance ("*" , 1 , True ), Decimal ('14.85 ' ))
285285
286286 # Now shield some funds using sendmany
287287 self .log .info ("TX11: Shielding coins to multiple destinations with sendmany RPC..." )
@@ -318,9 +318,9 @@ def run_test(self):
318318 # Verify balance
319319 self .nodes [2 ].generate (1 )
320320 self .sync_all ()
321- assert_equal (self .nodes [0 ].getshieldbalance (saplingAddr0 ), Decimal ('19 ' )) # 11 prev balance + 8 received
322- assert_equal (self .nodes [1 ].getshieldbalance (saplingAddr1 ), Decimal ('2' )) # 1 prev balance + 1 received
323- assert_equal (self .nodes [0 ].getshieldbalance (saplingAddr2 ), Decimal ('2.5 ' )) # 2 prev balance + 0.5 received
321+ assert_equal (self .nodes [0 ].getshieldbalance (saplingAddr0 ), Decimal ('20.9 ' )) # 12.9 prev balance + 8 received
322+ assert_equal (self .nodes [1 ].getshieldbalance (saplingAddr1 ), Decimal ('2.95 ' )) # 1.95 prev balance + 1 received
323+ assert_equal (self .nodes [0 ].getshieldbalance (saplingAddr2 ), Decimal ('4.4 ' )) # 3.9 prev balance + 0.5 received
324324 # Balance of node 0 is: prev_balance - 1 PIV (+fee) sent externally + 250 PIV matured coinbase
325325 assert_equal (self .nodes [0 ].getbalance (), satoshi_round (prev_balance + Decimal ('249' ) - Decimal (fee )))
326326
@@ -345,7 +345,7 @@ def run_test(self):
345345 # Verify balance
346346 self .nodes [2 ].generate (1 )
347347 self .sync_all ()
348- assert_equal (self .nodes [0 ].getshieldbalance (saplingAddr0 ), Decimal ('29 ' )) # 19 prev balance + 10 received
348+ assert_equal (self .nodes [0 ].getshieldbalance (saplingAddr0 ), Decimal ('30.9 ' )) # 20.9 prev balance + 10 received
349349
350350 self .log .info ("All good." )
351351
0 commit comments