-
Notifications
You must be signed in to change notification settings - Fork 74
Ethereum transactions logic and endpoints #1080
Conversation
01dccb4
to
fb80753
Compare
83fa752
to
4727c05
Compare
apps/ewallet/test/support/db_case.ex
Outdated
} | ||
) | ||
|
||
%{config_pid: config_pid} | ||
:ok = Application.put_env(:ewallet, :node_adapter, {:dumb, DumbAdapter}) |
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.
May be better to put it in the test.exs
config?
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.
1st batch
case Account.get(master_account_id) do | ||
nil -> | ||
{ | ||
Map.delete(attrs, "master_account"), | ||
{:master_account, {:error, prepare_error(master_account_id)}} | ||
[{:master_account, {:error, prepare_account_error(master_account_id)}} | errors] |
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.
Should we refactor/move this implementation detail inside e.g. prepare_account_error(errors, :master_account, master_account_id)
? Also prepare_hot_wallet_error(errors, :primary_hot_wallet, primary_hot_wallet_address)
.
apps/admin_api/lib/admin_api/v1/controllers/transaction_controller.ex
Outdated
Show resolved
Hide resolved
apps/eth_blockchain/lib/eth_blockchain/listeners/transaction_listener.ex
Show resolved
Hide resolved
apps/eth_blockchain/lib/eth_blockchain/listeners/transaction_listener.ex
Outdated
Show resolved
Hide resolved
apps/eth_blockchain/lib/eth_blockchain/listeners/transaction_listener.ex
Outdated
Show resolved
Hide resolved
adapter, | ||
state, | ||
confirmations_count, | ||
confirmations_count > (threshold || 10) |
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.
Can we define a module attribute for the default confirmations threshold (10) somewhere?
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.
I also wonder isn't it suppose to be >=
?
apps/eth_blockchain/lib/eth_blockchain/listeners/transaction_listener.ex
Show resolved
Hide resolved
apps/eth_blockchain/test/eth_blockchain/listeners/transaction_listener_test.exs
Show resolved
Hide resolved
apps/eth_blockchain/test/eth_blockchain/listeners/transaction_listener_test.exs
Outdated
Show resolved
Hide resolved
apps/eth_blockchain/test/eth_blockchain/listeners/transaction_listener_test.exs
Show resolved
Hide resolved
apps/eth_blockchain/test/eth_blockchain/listeners/transaction_listener_test.exs
Show resolved
Hide resolved
Merging, the linting issues will be fixed in the |
Issue/Task Number: #1060
Overview
This PR adds the first blockchain transaction flow, to send funds from the hot wallet directly to an external address. This should actually only be used to get funds out of the hot wallet and into one of the cold wallets used together as the pool of funds the eWallet has access to.
Changes
BlockchainTransactionGate
and aTransactionDispatcherGate
TransactionGate
toLocalTransactionGate
Usage
You will need to go through the blockchain setup that @mederic-p has done in order to have Geth setup properly.
Impact
You will need to run Geth in order to have the blockchain features working (errors aren't currently handled). Tests can be run without it.