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

Web3 integration #1114

Merged
merged 40 commits into from
Jul 18, 2019
Merged

Web3 integration #1114

merged 40 commits into from
Jul 18, 2019

Conversation

jarindr
Copy link
Contributor

@jarindr jarindr commented Jul 14, 2019

Issue/Task Number: #1092

Overview

Implement blockchain page to interact with web3 ( metamask )

Changes

  • Add blockchain page, check /ethereum
  • Integrate with blockchain modal.

Implementation Details

we use web3 provider for metamask integration, if metamask is not installed everything will be disable.

Usage

go to /ethereum try transfer from ETH address to ETH address

Impact

🔕

Copy link
Contributor

@nicholasmueller nicholasmueller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • in incognito (with no metamask) app wont boot
  • transaction works 👍

apps/frontend/assets/src/omg-web3/action.js Outdated Show resolved Hide resolved
@jarindr jarindr self-assigned this Jul 17, 2019
@jarindr jarindr added this to the v2.0 milestone Jul 17, 2019
@jarindr jarindr changed the title [WIP] Web3 integration Web3 integration Jul 18, 2019
@nicholasmueller
Copy link
Contributor

👍 only thing is pending status and account balance doesnt update after transaction completed. can be another pr too

@jarindr jarindr merged commit d40aa2f into frontend-eth-blockchain Jul 18, 2019
@jarindr jarindr added this to Done in eWallet via automation Jul 18, 2019
@jarindr jarindr deleted the web3-integration branch July 18, 2019 16:12
nicholasmueller added a commit that referenced this pull request Sep 17, 2019
* Fix send transaction

* Get ERC-20 fields for tokens

* Improve/fix existing code

* Add totalSupply as a valid erc20 field

* Refactor get blockchain balance to return nil if invalid contract

* Fix geth response parsing

* Add token gate

* mix format

* Add endpoint to verify erc20 capabilities of an address

* mix format

* improve error handling

* Add endpoint to set a contract address to a token

* Prepare the dumb adapter for :get_field

* Remove unused files [ci skip]

* Add tests

* update tests [ci skip]

* Silence warning

* Add blockchain seeds

* Update swagger

* Update create token to support blockchain address

* Implement functional blockchain transaction flow

* Test and refactor modules on eWallet side

* Add tests for blockchain registry

* Add tests / cleanup blockchain tx flow

* Add todos

* Refactor to not use EthBlockchain directly

* Properly unregister listener from registry

* Refactor

* Fix blockchain registry

* Specify dumb adapter in tests

* Fix Tracker registry

* Refactor

* Fix merge conflict

* Remove unused alias

* Add Address Tracker

* Add blockchain identifier to tokens

* Fix random test failure

* fix credo

* Implement Address Tracker and Block parser

* Use correct unique constraint

* Remove unused adapter function

* Fix inconsistent uses of if / else

* Cleanup the transaction listener with handle_continue

* Remove unnecessary %{}

* Start address tracker and fix syncing

* Rename is_blockchain_address

* explicitly call function

* Rename is_adapter_address

* Add doc

* Update error handlers

* Update error message

* Various small improvements

* Fix PR comments batch 1

* Use @doc for documentation

* Add BlockchainState schema

* Fix PR comments batch 2

* Blockchain wallet page (#1112)

* blockchain wallet page start

* seperate pages into their own files

* refactor how we show tab menu

* redux boilerplate and cleanup tokens page

* fetcher start

* naming

* add select blockchain wallet page before blockchain wallet detail

* renaming

* all renaming

* add search and tweaks

* render token remove align

* create blockchain transaction modal

* add blockchain transaction modal

* tweaks to blockchain transaction modal

* ui for transaction flow

* final style tweaks

* remove unused exchange logic

* tweak

* hide blockchain wallet pages to url only

* Add handling of HD Wallet in Keychain

* Add BlockchainHDWallet and BlockchainDepositWallet schemas

* Skip hot wallet generation if already present

* Add blockchain_wallet.create

* Update swagger

* Add blockchain_identifier to blockchain_wallet

* Add tests

* Update swagger

* Handle blockchain identifier when querying blockchain wallets

* Update seeds

* enable icon duration and actions on omg-alert (#1118)

* TMP: Rename commit

* Web3 integration  (#1114)

* add web3

* add empty page

* add metamask checker

* fix metamask actions

* add admin page

* add empty moda

* add selectors for balance

* add button

* add address

* add network info

* add custom token

* refactor blockchain modal

* yo

* fix packages

* add blockchain balance selector

* get balance

* hide password

* add what ?

* format

* fix address

* blur when value renderer change

* change form to div

* add decimal

* use util

* recalculate gas

* add disable

* hide connection

* fix lint

* add alert

* add alert and remove disable

* fix booting

* add disable state

* add etherscan

* cast string

* add pending blank

* hide custom token

* estimate gas with action

* remove unused code

* Add ability to receive funds internally with HD wallet

* Blockchain configuration page ui (#1122)

* get each page working

* grid styling to fit design

* fix navigating away from config page with changes

* fix radio styles

* dummy blockchain settings page

* connection notification on config

* blockchain network dropdown

* pr comments

* fix config side menu highlight

* fix alert wrapping bug

* Add simple tests for blockchain transaction received

* Switch to forked block_keys and fix blockchain deposit generation tests

* Add address tracker mocked integration test

* Fix key tests

* Remove auto-generation of ETH token

* Refactor transaction state machine

* Mix format

* Refer to blockchain identifier via EWallet.BlockchainHelper.identifier()

* Add blockchain_identifier index to blockchain_deposit_wallet

* Move PR review comments into TODOs

* Small fixes

* Add missing test cases

* Update failing tests due to refactor

* Fix code passing incorrect TransactionState.transition_to/4 params

* Fix missing parameter when calling TransactionTracker.init/1

* Fix TransactionTracker calling TransactionState.transition_to/4 incorrectly

* Move transaction's transition tests to TransactionStateTest

* Fix failing BlockchainTransactionGateTest

* Fix failing TransactionRegistryTest and TransactionTrackerTest

* Fix mismatching blockchain identifier for ConfigurationControllerTest

* Upgrade block_keys dependency to fix incorrect key derivation

* handle success message

* Add missing assert statements

* Allow blockchain_submitted status to immediately transition to blockchain_confirmed, skipping pending_confirmations

* Fix missing blockchain_identifier from blockchain seeding

* Fix incorrect :blockchain_deposit_wallet retrieval

* Add tests to WalletTest

* Add tests for BlockchainHDWallet

* generate deposit address

* Add tests for BlockchainDepositWallet

* Add tests for BlockchainDepositWalletGate

* Fix deposit wallet address serialization

* Remove eth_geth_adapter tests

* Remove basic forward call tests

* dont allow deposit address for burn wallet

* Fix association not loaded

* Combine index for blockchain_deposit_wallet's blockchain_hd_wallet_uuid and path_ref

* Add a controller test for generating deposit wallets for multiple wallets

* Fix test errors

* add wallet update when deposit address generated

* Fix more test errors

* Fix lintings

* get blockchain wallet balance

* Fix receiving funds

* create cold wallet modal and redux

* fix: lower case eth address and pagination

* show blockchain transfer button only if balance exists

* Add missing tests

* Add token test

* Notify failures to slack only for main branches

* Mix deps.get missing package

* Add keychain tests

* Move GethManager back to where it belongs

* Implement all Keychain tests

* Rename encrypted_private_key to private_key

* clean up transfer modals, add new ones for hot transfer

* Add missing EthBlockchain.Block tests

* Add missing EthBlockchain.Transaction tests

* Add EthBlockchain.Adapter tests

* refactor blockchain transaction modals

* enable metamask in coldwallet detail

* Add EWallet.BlockchainHelper tests

* Add EWallet.BlockchainAddressFetcher tests

* Fix EWallet.BlockchainDepositWalletGate test

* Add EWallet.LocalTransactionGate test and move test files to its rightful locations

* Fix EWallet.AddressTracker test

* Remove IO.inspect

* Small clean ups

* Formatting

* Fix credo

* small error

* render blockchain address on transaction

* Add UserGate tests

* implement blockchain transaction page

* Fix role constraint error

* Formatting

* Add BlockchainLocalTransactionGate tests

* Add EWallet.BlockchainStateGate tests

* Fix syntax error

* Formatting

* remove blockchain wallet settings and fix blockchain transfer modal to show eth address

* add advanced filter like transactions page

* Fix seed sample

* Fix instructions for miner.start() to 1 cpu thread only

* Make local geth testnet always refer its datadir to where the script is

* Fix amount conversion in BlockchainTransactionGate

* filter by blockchain address

* pass filter in query not fe

* Fix after merge conflicts

* fix filter query

* add info to from address on blockchain transfers

* fix check

* add submitted to blockchain filter status

* feature msg

* internal to external transfer modal

* fix modals to meet requirements

* fix tests

* update swagger docs

* exclude genesis

* hide blockchain settings for now

* Add internal -> external transfers

* Add internal -> transactions

* Formatting

* Use @failed instead of "failed"

* check metamask status when triggering external transfer

* hide genesis from wallet list

* block genesis and burn transfer, allow search in wallets

* Remove unused @ledger_confirmed status

* Rename @ledger_blockchain_confirmed to @ledger_pending_blockchain_confirmed

* Add docs describing each transaction status

* Formatting

* Fix typo

* Remove unused confirmations count

* Gave up enforcing :local_ledger_uuid field on transitioning to @confirmed

* Give up trying to fix @blockchain_submitted shortcutting to @blockchain_confirmed unlike @pending_confirmations

* Fix tests

* only allow blockchain eligible tokens to be transferred externally

* show if blockchain token in tokens table

* import token modal basic

* add metamask steps on import token flow

* fix metamask state change bug

* generate deposit address automatically if non existant on master account primary wallet

* pass blockchain address on token create, block import if imported already

* add blockchain token detail

* token transfer step to seperate component

* sendErc20 transaction web3 call

* create token chooser

* icons

* fix styling and errors

* refactor token mdoals to use modal controller

* clean up createtoken modal

* create blockchain token modal

* conditional mint if not locked

* typos and update blockchain transaction filter

* fix: typos

* more typos and cleanup

* typo

* Used mixed case when decoding

* Add EIP55 encoder module

* Add check for EIP55 and save addresses in db downcased

* fix pagination on blockchain wallet

* Change db type to citext

* Move DROP EXTENSION in down/0

* give spae to token balance

* fix token crash/bug on refresh

* remove address lowercasing, disallow minting for blockchain tokens

* lint

* fix import error
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
eWallet
  
5-Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants