There are no guarantees that send_message and receive_massage do not block
the flow of execution. Therefore they must be paired between Alice/Bob, one
send to one receive in the correct order.
Define Alice to call `receive_message` first, with Bob sending the message. Do
this because we are expecting Alice to be have a well known address, there is no
currently such assumption for Bob.
Previously there was a delay making a get raw transaction call to
give some time for a transaction to be confirmed on the blockchain.
This has been replaced with a loop that waits until the call is
succesful.
Previously we were testing the protocol by manually driving Alice and
Bob's state machines. This logic has now be moved to an async state
transition function that can take any possible state as input. The
state transition function is called in a loop until it returns the
desired state. This allows use to interrupt midway through the protocol
and perform refund and punish tests. This design was chosen over a
generator based implementation because the the generator based
implementation results in a impure state transition function that is
difficult to reason about and prone to bugs.
Test related code was extracted into the tests folder.
The 2b and 4b states were renamed to be consistent with the rest.
Macros were used to reduce code duplication when converting
child states to their parent states and vice versa.
Todos were added were neccessary.