Well, as always...it depends.
So Ill make a few assumptions here and one of these may answer your question.
Earnest money is due within 3 days by 5pm on the third IF there was earnest money offered in the contract. (you can in fact put a house under contract and elect not to put up earnest money. As long as both parties agree its a valid contract. NOT SAYING TO DO THIS...in fact don't ever do this, It's just sheisty. but it is legal in texas)
The contract can be terminated without reason in the time period provided on page 8 of the contract (option period). if NO option period was given in the contract AND the buyer decided to terminate the contract then you are within your legal right to receive the earnest money that had not been deposited yet.
IF you agreed to an option period and they decide to terminate within that option period window then you will receive the option fee only and the earnest money goes back to the seller.