@@ -13,7 +13,7 @@ class ColdStakingSpending(NavCoinTestFramework):
1313 def __init__ (self ):
1414 super ().__init__ ()
1515 self .setup_clean_chain = True
16- self .num_nodes = 2
16+ self .num_nodes = 1
1717 # set up nodes
1818 def setup_network (self , split = False ):
1919 self .nodes = self .setup_nodes ()
@@ -52,7 +52,8 @@ def run_test(self):
5252
5353 # send funds to the cold staking address (leave some nav for fees) -- we specifically require
5454 # a transaction fee of minimum 0.002884 navcoin due to the complexity of this transaction
55- self .nodes [0 ].sendtoaddress (coldstaking_address_spending , float (self .nodes [0 ].getbalance ()) - MIN_COLDSTAKING_SENDING_FEE )
55+ tx = self .nodes [0 ].sendtoaddress (coldstaking_address_spending , float (self .nodes [0 ].getbalance ()) - MIN_COLDSTAKING_SENDING_FEE )
56+ fee = self .nodes [0 ].gettransaction (tx )['fee' ]
5657 # put transaction in new block & update blockchain
5758 slow_gen (self .nodes [0 ], 1 )
5859 # create list for all coldstaking utxo recieved
@@ -72,7 +73,7 @@ def run_test(self):
7273 # difference between balance after sending and previous balance is the same when block reward is removed
7374 # values are converted to string and "00" is added to right of == operand because values must have equal num of
7475 # decimals
75- assert ( str ( balance_post_send_one - BLOCK_REWARD ) <= ( str ( float ( balance_before_send ) - MIN_COLDSTAKING_SENDING_FEE ) + "00" ))
76+ assert_equal ( balance_post_send_one - BLOCK_REWARD , balance_before_send + fee ) # FEE IS negative already so we ADD it
7677
7778 """check staking weight now == 0 (we don't hold the staking key)"""
7879
0 commit comments