* Drop the in-memory database
Fixes#607
This PR drops the implementation of in-memory database traits.
They are useful for testing purposes since the tests should test our codebase
and assume the database works as expected (although a follow-up PR should write
a sanity test suite for all database trait implementors).
As complexity is worth with database requirements to simplify complexity and
add more robustness, for instance, with the following plans to add support for
transactions or buffered writes, it would become more complex and
time-consuming to support a correct database trait. This PR drops the
implementation and replaces it with a SQLite memory instance
* Remove OnceCell<Mint>
Without this change, a single Mint is shared for all tests, and the first tests
to run and shutdown makes the other databases (not-reachable, as dropping the
tokio engine would also drop the database instance).
There is no real reason, other than perhaps performance. The mint should
perhaps run in their own tokio engine and share channels as API interfaces, or
a new instance should be created in each tests
* Fixed bug with foreign keys
[1] https://gist.github.com/crodas/bad00997c63bd5ac58db3c5bd90747ed
* Show more debug on failure
* Remove old code
* Remove old references to WalletMemoryDatabase
* refactor: consolidate validation checks
* refactor: melt verification checks
* refactor: mint verification
* chore: clippy
* chore: use error codes
* fix: order of verifications
* fix: p2pk test ws updates
We only expect the proof to be set to pending once. As a proof without
a signature failes before the spent check where the state is chaged.
* fix: mint_melt regtest frome wait
The default would have been min=0, max=0. This made any mint initialized with MintMeltLimits::default() to fail every mint and melt operation, because the amount was out of bounds.
* Add ArcSwap to update Mint configuration at runtime
The main goal is to change settings without having multiple RwLock everywhere,
instead having ArcSwap to update the configuration without having access to a
mutable reference to the Mint.
This will allow the RPC Server, or any other medium to update the Mint without
minimum contention.
* Rename structs
* Move quote_ttl to the new config
* Fixed clippy issues