printing the sold message and removing the existing coin from orders.json only makes sense if test_mode=false and if the order didn't raise an exception.
The code as it was could delete the order from orders.json regardless if it was successful or not.
printing the sold message and removing the existing coin from
orders.json
only makes sense iftest_mode=false
and if the order didn't raise an exception.The code as it was could delete the order from
orders.json
regardless if it was successful or not.