This repository has been archived by the owner on Jun 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 74
Supporting internal -> external transactions #1143
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unnawut
reviewed
Aug 27, 2019
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 pretty much the same pattern as the existing blockchain transaction code so...
apps/ewallet_db/lib/ewallet_db/state_machines/transaction_state.ex
Outdated
Show resolved
Hide resolved
7fd8be9
to
eb23e45
Compare
…in_confirmed unlike @pending_confirmations
@T-Dnzt Can you have a look at my changes? Looking commit by commit will be much easier... |
…ything with local insert
Missing: Handle cached balance for pending transaction that turn to failed. |
mederic-p
reviewed
Sep 4, 2019
apps/ewallet/lib/ewallet/gates/transactions/blockchain_transaction_gate.ex
Outdated
Show resolved
Hide resolved
Looks good, as Mederic pointed out, we need to re-calculate the cached balance (from the beginning) when a ledger transaction is switched to |
mederic-p
reviewed
Sep 4, 2019
Can't approve because I made the PR, but LGTM 👍 |
unnawut
approved these changes
Sep 9, 2019
mederic-p
approved these changes
Sep 9, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue/Task Number: #1086
Overview
This PR adds the support for internal to external, in the fastest possible way. The code isn't super clean, let's be honest, but it works.
Changes
Implementation Details
Add a new status to local ledger transactions, that's defaulting to
confirmed
. The eWallet can specify a transaction as being pending, which means it's included into the calculations, but can be turned into a failed transaction, which will not be counted.