Commit Graph

7 Commits

Author SHA1 Message Date
rishflab
a29786e175 Use external serialisation implementation 2020-10-22 19:41:52 +11:00
rishflab
03dee7a3ea Generate temp dir for db 2020-10-22 19:34:53 +11:00
rishflab
3e82211a82 Add database todos 2020-10-22 19:27:28 +11:00
rishflab
e3b68a3864 Improve database type safety
The database is now bound to a type eg. alice::State or bob::State.
The caller cannot expect to retrieve a type that is different to
the type that was stored.
2020-10-22 18:09:16 +11:00
rishflab
8eda051087 Remove redundant serialisation implementation
ECDSAfun's serialisation implementation was already imported
making the custom implementation redundant

Remove remnants of stale comment

Remove redundant conversion

Rename params to be consistent
2020-10-22 18:09:16 +11:00
Tobin C. Harding
2a07113074 Fix buld after merge of db branch 2020-10-22 08:28:51 +11:00
rishflab
39afb4196b Save and recover protocol state from disk
NOTE: This implementation saves secrets to disk! It is not
secure.

The storage API allows the caller to atomically record the state
of the protocol. The user can retrieve this recorded state and
re-commence the protocol from that point. The state is recorded
using a hard coded key, causing it to overwrite the previously
recorded state. This limitation means that this recovery
mechanism should not be used in a program that simultaneously
manages the execution of multiple swaps.

An e2e test was added to show how to save, recover and resume
protocol execution. This logic could also be integrated into the
run_until functions to automate saving but was not included at
this stage as protocol execution is currently under development.

Serialisation and deserialisation was implemented on the states
to allow the to be stored using the database. Currently the
secret's are also being stored to disk but should be recovered
from a seed or wallets.
2020-10-21 18:39:45 +11:00