From a6a0d4c5a988e8f3edcffb60f3f407568a259aa7 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Tue, 2 Apr 2019 13:20:45 +0300 Subject: [PATCH] fix test --- apps/indexer/lib/indexer/token/fetcher.ex | 2 +- apps/indexer/test/indexer/token/fetcher_test.exs | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/apps/indexer/lib/indexer/token/fetcher.ex b/apps/indexer/lib/indexer/token/fetcher.ex index 52f504f629..818f27f138 100644 --- a/apps/indexer/lib/indexer/token/fetcher.ex +++ b/apps/indexer/lib/indexer/token/fetcher.ex @@ -71,7 +71,7 @@ defmodule Indexer.Token.Fetcher do |> MetadataRetriever.get_functions_of() |> Map.put(:cataloged, true) - {:ok, _} = Chain.update_token(token, token_params) + {:ok, _} = Chain.update_token(%{token | updated_at: DateTime.utc_now()}, token_params) :ok end end diff --git a/apps/indexer/test/indexer/token/fetcher_test.exs b/apps/indexer/test/indexer/token/fetcher_test.exs index 85872a70c5..9fdd3ab5c4 100644 --- a/apps/indexer/test/indexer/token/fetcher_test.exs +++ b/apps/indexer/test/indexer/token/fetcher_test.exs @@ -13,19 +13,13 @@ defmodule Indexer.Token.FetcherTest do describe "init/3" do test "returns uncataloged tokens", %{json_rpc_named_arguments: json_rpc_named_arguments} do insert(:token, cataloged: true) - %Token{contract_address_hash: uncatalog_address} = insert(:token, cataloged: false) + %Token{contract_address_hash: uncatalog_address} = insert(:token, cataloged: false) |> IO.inspect() assert Fetcher.init([], &[&1 | &2], json_rpc_named_arguments) == [uncatalog_address] end end describe "run/3" do - test "skips tokens that have already been cataloged", %{json_rpc_named_arguments: json_rpc_named_arguments} do - expect(EthereumJSONRPC.Mox, :json_rpc, 0, fn _, _ -> :ok end) - %Token{contract_address_hash: contract_address_hash} = insert(:token, cataloged: true) - assert Fetcher.run([contract_address_hash], json_rpc_named_arguments) == :ok - end - test "catalogs tokens that haven't been cataloged", %{json_rpc_named_arguments: json_rpc_named_arguments} do token = insert(:token, name: nil, symbol: nil, total_supply: nil, decimals: nil, cataloged: false) contract_address_hash = token.contract_address_hash