From 455adaddcadcc60c7527b288932023c49a531479 Mon Sep 17 00:00:00 2001 From: Luke Imhoff Date: Wed, 16 May 2018 08:36:12 -0500 Subject: [PATCH] Use same code for decode Explorer.Chain.Hash and Explorer.Chain.Code --- apps/explorer/lib/explorer/chain/hash.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/explorer/lib/explorer/chain/hash.ex b/apps/explorer/lib/explorer/chain/hash.ex index 3967681844..acc96510ad 100644 --- a/apps/explorer/lib/explorer/chain/hash.ex +++ b/apps/explorer/lib/explorer/chain/hash.ex @@ -196,8 +196,8 @@ defmodule Explorer.Chain.Hash do hexadecimal_digit_count = byte_count_to_hexadecimal_digit_count(byte_count) with ^hexadecimal_digit_count <- String.length(hexadecimal_digits), - {integer, ""} <- Integer.parse(hexadecimal_digits, 16) do - cast_integer(integer, byte_count) + {:ok, bytes} <- Base.decode16(hexadecimal_digits, case: :mixed) do + {:ok, %__MODULE__{byte_count: byte_count, bytes: bytes}} else _ -> :error end