From 1f902e1af38797565bea5aaee6a0e467779a8fea Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Wed, 4 Sep 2019 14:19:19 +0300 Subject: [PATCH] fix token helpers test --- .../test/block_scout_web/views/tokens/helpers_test.exs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/block_scout_web/test/block_scout_web/views/tokens/helpers_test.exs b/apps/block_scout_web/test/block_scout_web/views/tokens/helpers_test.exs index 2cbfd2c0a5..817a3137d6 100644 --- a/apps/block_scout_web/test/block_scout_web/views/tokens/helpers_test.exs +++ b/apps/block_scout_web/test/block_scout_web/views/tokens/helpers_test.exs @@ -8,28 +8,28 @@ defmodule BlockScoutWeb.Tokens.HelpersTest do token = build(:token, type: "ERC-20") token_transfer = build(:token_transfer, token: token, amount: nil) - assert Helpers.token_transfer_amount(token_transfer) == "--" + assert Helpers.token_transfer_amount(token_transfer) == {:ok, "--"} end test "returns the formatted amount according to token decimals with ERC-20 token" do token = build(:token, type: "ERC-20", decimals: Decimal.new(6)) token_transfer = build(:token_transfer, token: token, amount: Decimal.new(1_000_000)) - assert Helpers.token_transfer_amount(token_transfer) == "1" + assert Helpers.token_transfer_amount(token_transfer) == {:ok, "1"} end test "returns the formatted amount when the decimals is nil with ERC-20 token" do token = build(:token, type: "ERC-20", decimals: nil) token_transfer = build(:token_transfer, token: token, amount: Decimal.new(1_000_000)) - assert Helpers.token_transfer_amount(token_transfer) == "1,000,000" + assert Helpers.token_transfer_amount(token_transfer) == {:ok, "1,000,000"} end test "returns a string with the token_id with ERC-721 token" do token = build(:token, type: "ERC-721", decimals: nil) token_transfer = build(:token_transfer, token: token, amount: nil, token_id: 1) - assert Helpers.token_transfer_amount(token_transfer) == "TokenID [1]" + assert Helpers.token_transfer_amount(token_transfer) == {:ok, :erc721_instance} end test "returns nothing for unknown token's type" do