-
Notifications
You must be signed in to change notification settings - Fork 63
feat: utxo locking #112
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
feat: utxo locking #112
Conversation
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.
This was drafted in the previous review, but it must have been deleted when I thought I was de-duping responses.
0b6f39d
to
4fd158b
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.
Great work here @mkazlauskas . My review is still in progress, but submitting early for advanced notice. What does the withdrawal example look like positioned as an integration test? The need for an example is really just pointing out a gap in our tests, which gains us the assurance we cannot otherwise have with pure examples.
e42d9b0
to
3312fd5
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.
Looks good! Please squash into minimal commits, then we're ready to merge.
feat(wallet): implement InMemoryTransactionTracker
…to it refactor: change Provider.submitTx return type to Promise<void>, use ProviderError
…withdrawal.ts, enable coverage
…th availableUtxo set
refactor(wallet): change event-naming, rename trackTransaction->track, a few small improvements
d3c0e5b
to
a5bc91f
Compare
Context
Need to provide functionality that wallets need to prevent double-spend attempts.
Proposed Solution
availableUtxos
field toUtxoRepository
and implement it forInMemoryUtxoRepository
InMemoryTransactionTracker
Important Changes Introduced
flushPromises
utility function toutil-dev
package,cslToOgmios.txIn
tocore
packagetransactionUntracked
event toInMemoryUtxoRepository
. To recover user should attempt to call TransactionTracker.trackTransaction manually.MockProvider
to usejest.fn
forutxoDelegationAndRewards
and a few other provider functions.ProviderError
and implement the conversion forblockfrostProvider
.@typescript-eslint/no-floating-promises
and disable@typescript-eslint/no-var-requires
(covered by unicorn/prefer-module)