Skip to content

Commit

Permalink
refactor: replace exception with error on account validation
Browse files Browse the repository at this point in the history
  • Loading branch information
jyeshe committed Jul 11, 2022
1 parent 8806340 commit 94237f0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/ae_mdw_web/controllers/aex9_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,15 @@ defmodule AeMdwWeb.Aex9Controller do
"account_id" => account_id
}) do
with {:ok, {type, height, hash}} <- ensure_block_hash(block_hash_enc),
{:ok, contract_pk} <- ensure_aex9_contract_at_block(state, contract_id, hash) do
{:ok, contract_pk} <- ensure_aex9_contract_at_block(state, contract_id, hash),
{:ok, account_pk} <- Validate.id(account_id, [:account_pubkey]) do
handle_input(
conn,
fn ->
balance_for_hash_reply(
conn,
contract_pk,
Validate.id!(account_id, [:account_pubkey]),
account_pk,
{type, height, hash}
)
end
Expand Down

0 comments on commit 94237f0

Please sign in to comment.