Skip to content

Commit

Permalink
chore: add function parameter alias to contract logs (#1374)
Browse files Browse the repository at this point in the history
  • Loading branch information
jyeshe committed Jun 2, 2023
1 parent d5f1381 commit 25ece54
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
13 changes: 10 additions & 3 deletions docs/swagger_v2/contracts.spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,21 +118,28 @@ paths:
required: false
schema:
type: string
example: "Transfer"
example: Transfer
- name: function
in: query
description: Prefix of the contract called function
required: false
schema:
type: string
example: "mint"
example: mint
- name: function_prefix
in: query
description: Prefix of the contract called function
required: false
schema:
type: string
example: put
- name: data
in: query
description: Data prefix from the contract call
required: false
schema:
type: string
example: "AB"
example: AB
- name: aexn-args
in: query
description: Indicates to format args when event is AEX-N
Expand Down
4 changes: 4 additions & 0 deletions lib/ae_mdw/contracts.ex
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,10 @@ defmodule AeMdw.Contracts do
do: {:event_hash, :aec_hash.blake2b_256_hash(ctor_name)}

defp convert_param(_state, {"function", fname}) when byte_size(fname) > 0, do: {:fname, fname}

defp convert_param(state, {"function_prefix", fname}),
do: convert_param(state, {"function", fname})

defp convert_param(_state, {"aexn-args", _}), do: {:ignore, nil}

defp convert_param(_state, {id_key, id_val}) do
Expand Down

0 comments on commit 25ece54

Please sign in to comment.