diff --git a/apps/explorer/lib/explorer/chain/wei.ex b/apps/explorer/lib/explorer/chain/wei.ex index 4b12d3deb0..0739885cf8 100644 --- a/apps/explorer/lib/explorer/chain/wei.ex +++ b/apps/explorer/lib/explorer/chain/wei.ex @@ -68,6 +68,11 @@ defmodule Explorer.Chain.Wei do @impl Ecto.Type def cast(_), do: :error + def cast!(arg) do + {:ok, wei} = cast(arg) + wei + end + @impl Ecto.Type def dump(%__MODULE__{value: %Decimal{} = decimal}) do {:ok, decimal} @@ -76,6 +81,11 @@ defmodule Explorer.Chain.Wei do @impl Ecto.Type def dump(_), do: :error + def dump!(arg) do + {:ok, decimal} = dump(arg) + decimal + end + @impl Ecto.Type def load(%Decimal{} = decimal) do {:ok, %__MODULE__{value: decimal}}