-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use SQLite in integration tests scenarios (instead of MVar) #406
Conversation
14fcfeb
to
9ae58b8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, removing the pending table simplifies things.
Seems like the integration tests are hanging forever in case of failure, like something preventing the thread from dying. I guess that because the SQLite connection is never closed. I'll have a look. |
…rmed UTxO from a checkpoint The SQLite implementation was storing 'totalUTxO' which is completely invalid since this: - does not contain the pending UTxO - does contain the change UTxO So, after storing a checkpoint and recovering it from the DB, we'll end up with the same UTxO as-if all pending txs were accepted and not pending anymore.
…-machine when reading checkpoint Pending transactions can actually be inserted independently of the wallet checkpoints. So, if we insert a checkpoint after we inserted some pending txs, reading that checkpoint again should yield those pending txs.
…toring checkpoint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM module the hanging tests upon fail
378313f
to
f79f3a3
Compare
f79f3a3
to
39bcc46
Compare
Issue Number
#154
Overview
totalUTxO
when storing the checkpoint, which is a modified version of the actual checkpoint UTxO. Fixed by providing a new accessor to get the "raw" UTxO of a checkpoint.PendingTx
table storing pending transactions identified by the wallet id and a slot. That is redundant with theTxMeta
already stored, plus, it was not maintained properly and wouldn't yield the correct pending txs when restoring a checkpoint.repsert
inps and outs when inserting pending txs of a checkpoint because inputs or outputs may have been inserted by some previous transactions!Comments
It'd be nice to find some sort of invariant to enforce regarding pending txs and the corresponding checkpoint. We don't expect
putTxHistory
to be called without aputCheckpoint
following either before or after. One way to deal with this could be:putTxHistory
is never called with pending txsTxMeta
in the checkpoint, such thatputCheckpoint
has enough information to fully store a pending tx.edit: Addressed points above in a last commit.