@@ -833,16 +833,20 @@ def history_fetched(ec, history):
833833
834834 outputs .append ({'value' : moderator_fee , 'address' : moderator_address })
835835 dispute_json ["dispute_resolution" ]["resolution" ]["moderator_address" ] = moderator_address
836- dispute_json ["dispute_resolution" ]["resolution" ]["moderator_fee" ] = moderator_fee
837- dispute_json ["dispute_resolution" ]["resolution" ]["transaction_fee" ] = TRANSACTION_FEE
836+ dispute_json ["dispute_resolution" ]["resolution" ]["moderator_fee" ] = \
837+ round (moderator_fee / float (100000000 ), 8 )
838+ dispute_json ["dispute_resolution" ]["resolution" ]["transaction_fee" ] = \
839+ round (TRANSACTION_FEE / float (100000000 ), 8 )
838840 if float (buyer_percentage ) > 0 :
839841 amt = int (float (buyer_percentage ) * satoshis )
840- dispute_json ["dispute_resolution" ]["resolution" ]["buyer_payout" ] = amt
842+ dispute_json ["dispute_resolution" ]["resolution" ]["buyer_payout" ] = \
843+ round (amt / float (100000000 ), 8 )
841844 outputs .append ({'value' : amt ,
842845 'address' : buyer_address })
843846 if float (vendor_percentage ) > 0 :
844847 amt = int (float (vendor_percentage ) * satoshis )
845- dispute_json ["dispute_resolution" ]["resolution" ]["vendor_payout" ] = amt
848+ dispute_json ["dispute_resolution" ]["resolution" ]["vendor_payout" ] = \
849+ round (amt / float (100000000 ), 8 )
846850 outputs .append ({'value' : amt ,
847851 'address' : vendor_address })
848852
@@ -916,15 +920,18 @@ def release_funds(self, order_id):
916920
917921 outputs = []
918922
919- outputs .append ({'value' : int (contract ["dispute_resolution" ]["resolution" ]["moderator_fee" ]),
923+ outputs .append ({'value' : int (float (contract ["dispute_resolution" ]
924+ ["resolution" ]["moderator_fee" ]) * 100000000 ),
920925 'address' : contract ["dispute_resolution" ]["resolution" ]["moderator_address" ]})
921926
922927 if "buyer_payout" in contract ["dispute_resolution" ]["resolution" ]:
923- outputs .append ({'value' : int (contract ["dispute_resolution" ]["resolution" ]["buyer_payout" ]),
928+ outputs .append ({'value' : int (float (contract ["dispute_resolution" ]
929+ ["resolution" ]["buyer_payout" ]) * 100000000 ),
924930 'address' : buyer_address })
925931
926932 if "vendor_payout" in contract ["dispute_resolution" ]["resolution" ]:
927- outputs .append ({'value' : int (contract ["dispute_resolution" ]["resolution" ]["vendor_payout" ]),
933+ outputs .append ({'value' : int (float (contract ["dispute_resolution" ]
934+ ["resolution" ]["vendor_payout" ]) * 100000000 ),
928935 'address' : vendor_address })
929936
930937 tx = BitcoinTransaction .make_unsigned (outpoints , outputs )
@@ -1025,7 +1032,7 @@ def refund(self, order_id):
10251032 refund_json ["refund" ]["order_id" ] = order_id
10261033 if "moderator" in contract ["buyer_order" ]["order" ]:
10271034 sigs = tx .create_signature (vendor_priv , redeem_script )
1028- refund_json ["refund" ]["value" ] = tx .get_out_value ()
1035+ refund_json ["refund" ]["value" ] = round ( tx .get_out_value () / float ( 100000000 ), 8 )
10291036 refund_json ["refund" ]["signature(s)" ] = sigs
10301037 else :
10311038 tx .sign (vendor_priv )
0 commit comments