DB
The current path is now saved to, and loaded from, an on-disk database. The database is updated every time a diff is applied. The database used is BoltDB. An interface has been defined for the database so that it may be switched out later. The interface is very limited, only supporting insertions/deletions at the end of the current path (read-only operations, however, are random-access).
This means that the State now contains a db
field, and must be passed a saveDir
like the other modules. This required rewriting the consensus testing functions in the style of the other modules. (Namely, they each have to live in a separate folder.)
The upside is that the current path can now persist across sessions, which fixes #98 (closed). The downside is that the disk I/O incurred by the database slows down tests considerably. To compensate, the database is only used for long tests. Short tests use a dummy "NilDB" whose methods are no-ops.