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

Commit

Permalink
Thorough dialyzer analysis (#424)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ino Murko authored and unnawut committed Aug 17, 2018
1 parent b8f3860 commit a0a6a76
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ defmodule EWallet.TransactionConsumptionFetcher do
defp return_consumption(consumption), do: {:ok, consumption}

@spec idempotent_fetch(String.t()) ::
{:ok, %TransactionConsumption{}}
{:ok, nil}
| {:idempotent_call, %TransactionConsumption{}}
| {:error, %TransactionConsumption{}, atom(), String.t()}
| {:error, %TransactionConsumption{}, String.t(), String.t()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ defmodule EWallet.TransactionConsumptionConfirmerGate do
alias Ecto.Changeset

@spec approve_and_confirm(%TransactionRequest{}, %TransactionConsumption{}) ::
{:ok, %TransactionConsumption{}}
| {:error, %TransactionConsumption{}, atom(), String.t()}
{:error, %TransactionConsumption{}, atom(), String.t()}
| {:error, %TransactionConsumption{}, String.t(), String.t()}
def approve_and_confirm(request, consumption) do
consumption
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ defmodule EWallet.TransactionConsumptionConsumerGate do
{:ok, %TransactionConsumption{}}
| {:error, %TransactionConsumption{}}
| {:error, atom()}
| {:error, atom(), String.t()}
def consume(
%{
"account_id" => account_id,
Expand Down Expand Up @@ -147,7 +148,8 @@ defmodule EWallet.TransactionConsumptionConsumerGate do

def consume(_attrs), do: {:error, :invalid_parameter}

@spec consume(%User{} | %Wallet{}, map()) :: {:ok, %TransactionConsumption{}} | {:error, atom()}
@spec consume(%User{} | %Wallet{}, map()) ::
{:ok, %TransactionConsumption{}} | {:error, atom()} | {:error, atom(), String.t()}
def consume(
%User{} = user,
%{
Expand Down
1 change: 1 addition & 0 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ defmodule EWallet.Umbrella.Mixfile do
aliases: aliases(),
docs: docs(),
dialyzer: [
flags: [:underspecs, :unknown, :unmatched_returns],
plt_add_apps: [:iex, :mix],
ignore_warnings: ".dialyzer_ignore.exs"
]
Expand Down

0 comments on commit a0a6a76

Please sign in to comment.