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

Update tokens, prepare blockchain integration #1081

Merged
merged 66 commits into from
Jul 24, 2019

Conversation

mederic-p
Copy link
Contributor

@mederic-p mederic-p commented Jun 28, 2019

Issue/Task Number: 695
Closes #695, #1061, #701, #704

Overview

This PR adds the logic to create/update blockchain tokens.
It also adds a new command to the seeds in order to seed the primary hot wallet and the default token for current the blockchain (Eth for now).

Changes

  • Add token.get_erc20_capabilities to retrieve attributes of a given ERC20 token
  • Add token.set_blockchain_address to set the blockchain address of a token.
  • Update token.create to allow a blockchain_address.
  • Add mix seed --blockchain to generate the default blockchain token and the primary hot wallet.

Implementation Details

Usage

The easiest is to try the new endpoints in swagger.
For the seeds:
First run the normal seeds: mix seed, then run mix seed --blockchain.

Copy link
Contributor

@unnawut unnawut left a comment

Choose a reason for hiding this comment

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

1st batch at ~46/66 files

apps/ewallet/lib/ewallet/helpers/blockchain_helper.ex Outdated Show resolved Hide resolved
apps/ewallet/lib/ewallet/helpers/blockchain_helper.ex Outdated Show resolved Hide resolved
apps/ewallet/lib/ewallet/helpers/blockchain_helper.ex Outdated Show resolved Hide resolved
apps/eth_blockchain/lib/eth_blockchain/helper.ex Outdated Show resolved Hide resolved
apps/eth_blockchain/lib/eth_blockchain/helper.ex Outdated Show resolved Hide resolved
apps/eth_blockchain/lib/eth_blockchain/error_handler.ex Outdated Show resolved Hide resolved
apps/eth_blockchain/lib/eth_blockchain/error_handler.ex Outdated Show resolved Hide resolved
apps/eth_blockchain/lib/eth_blockchain/error_handler.ex Outdated Show resolved Hide resolved
apps/ewallet_db/config/config.exs Show resolved Hide resolved
apps/ewallet/lib/ewallet/gates/mint_gate.ex Outdated Show resolved Hide resolved
@mederic-p mederic-p changed the base branch from 1060-eth-transactions-logic to eth-blockchain July 12, 2019 03:15
end

def run(writer, _args) do
{:ok, {address, public_key}} = Wallet.generate()
Copy link

Choose a reason for hiding this comment

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

This will create a new Keychain wallet everytime we run the seeds :)

@mederic-p mederic-p requested review from T-Dnzt and sirn July 18, 2019 07:06
Copy link
Contributor

@unnawut unnawut left a comment

Choose a reason for hiding this comment

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

🎖🥇🍾🌟❤️

@@ -107,8 +109,10 @@ defmodule AdminAPI.V1.BlockchainWalletController do
defp paginated_tokens(attrs), do: paginated_blockchain_tokens(Token, attrs)

defp paginated_blockchain_tokens(query, attrs) do
query
|> Token.query_all_blockchain()
identifier = BlockchainHelper.identifier()
Copy link

Choose a reason for hiding this comment

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

Could just put it directly in line 114? Since identifier isn't used anywhere else in this function.

@mederic-p mederic-p merged commit 55cf62b into eth-blockchain Jul 24, 2019
@mederic-p mederic-p deleted the 695-update-token-erc20 branch July 24, 2019 08:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants