Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Extract transaction into blockchain_transaction #1157

Closed
unnawut opened this issue Sep 12, 2019 · 0 comments
Closed

Extract transaction into blockchain_transaction #1157

unnawut opened this issue Sep 12, 2019 · 0 comments
Assignees
Labels
flag/ethereum integration kind/refactor ⚙️ This is only about refactoring, no new feature. location/backend p2/normal This is something that should be done
Projects
Milestone

Comments

@unnawut
Copy link
Contributor

unnawut commented Sep 12, 2019

Is your feature request related to a problem? Please describe.

Currently we have EWalletDB.Transaction containing some local information as well as blockchain information. We're also about to have EWalletDB.DepositTransaction, etc. which means a lot of blockchain info will be duplicated in the database.

Describe the solution you'd like

The idea is to consolidate blockchain transaction info into EWalletDB.BlockchainTransaction so there's only a single source of truth and keeping separation of concern between transactions and blockchain transactions.

This also means that EWalletDB.TransactionState will also need to be refactored, but will pave way for simpler state machines.

Additional context

In @mederic-p's own words:

I’m starting to think that we should have a new blockchain_transaction table with the following fields (at least):

  • :status
  • :blockchain_tx_hash
  • :blockchain_identifier
  • :confirmations_count
  • :blk_number
    So we can reference this blockchain transaction in the tables that need it. For now we store these fields directly in the tables but we will have a lot of duplicates. We will need it for at least transaction (when creating a blockchain transaction), token when deploying an erc20 token, mint when minting a token, maybe more.
    This will also allow an entity to reference multiple blockchain transactions. A token that we create will have a creation_blockchain_tx_id and can also have a reference to a middle table for all its minting_blockchain_tx and can have a finish_minting_blockchain_tx_id.

Inputs from @T-Dnzt:

Both ethereum and plasma transactions go into blockchain_transaction table

token and mint need to be refactored to contain only blockchain_transaction_uuid reference

Deposit transactions do need to exist because they contain logic that doesn't belong in a generic blockchain transaction table, to show the list of all deposit transactions happening and if it's going in or out to/from the hot wallet.

@unnawut unnawut added kind/enhancement 🚀 New feature or request p2/normal This is something that should be done location/backend labels Sep 12, 2019
@unnawut unnawut added this to the v2.0 milestone Sep 12, 2019
@unnawut unnawut self-assigned this Sep 12, 2019
@unnawut unnawut added this to 2-TODO in eWallet Sep 12, 2019
@unnawut unnawut added kind/refactor ⚙️ This is only about refactoring, no new feature. flag/ethereum integration and removed kind/enhancement 🚀 New feature or request labels Sep 12, 2019
@mederic-p mederic-p moved this from 2-TODO to 3-In Progress in eWallet Sep 24, 2019
@mederic-p mederic-p self-assigned this Sep 24, 2019
@unnawut unnawut removed their assignment Sep 30, 2019
@unnawut unnawut closed this as completed Oct 29, 2019
eWallet automation moved this from 3-In Progress to 5-Done Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
flag/ethereum integration kind/refactor ⚙️ This is only about refactoring, no new feature. location/backend p2/normal This is something that should be done
Projects
eWallet
  
5-Done
Development

No branches or pull requests

2 participants