Skip to content

Commit

Permalink
rename evm_event_details->evm_token
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew7234 committed Jul 27, 2023
1 parent fc4269e commit 1c2e9a3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
15 changes: 7 additions & 8 deletions api/spec/v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2118,8 +2118,8 @@ components:
The decoded `evm.log` event data. We currently support only two types of evm events, ERC20 `Transfer`
and `Approve`.
Absent if the event type is not `evm.log`.
evm_event_details:
$ref: '#/components/schemas/EvmEventDetails'
evm_token:
$ref: '#/components/schemas/EvmEventToken'
description: An event emitted by the runtime layer

RuntimeEventType:
Expand Down Expand Up @@ -2153,25 +2153,24 @@ components:
Values of EVM type `bytes` and `bytes<N>` are represented as base64 strings.
Values of other EVM types (integer types, strings, arrays, etc.) are represented as their JSON counterpart.
EvmEventDetails:
EvmEventToken:
type: object
properties:
token_type:
type:
$ref: '#/components/schemas/EvmTokenType'
token_symbol:
symbol:
type: string
description: Symbol of the token, as provided by token contract's `symbol()` method.
example: USDT
token_decimals:
decimals:
type: integer
description: |
The number of least significant digits in base units that should be displayed as
decimals when displaying tokens. `tokens = base_units / (10**decimals)`.
Affects display only. Often equals 18, to match ETH.
example: 18
description: |
Additional information related to the event. The semantics of the member fields
depends on the event type.
Details about the EVM token involved in the event, if any.
RuntimeEvmContract:
type: object
Expand Down
12 changes: 6 additions & 6 deletions storage/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1296,7 +1296,7 @@ func (c *StorageClient) RuntimeEvents(ctx context.Context, p apiTypes.GetRuntime
}
for res.rows.Next() {
var e RuntimeEvent
var ed apiTypes.EvmEventDetails
var et apiTypes.EvmEventToken
if err := res.rows.Scan(
&e.Round,
&e.TxIndex,
Expand All @@ -1307,14 +1307,14 @@ func (c *StorageClient) RuntimeEvents(ctx context.Context, p apiTypes.GetRuntime
&e.Body,
&e.EvmLogName,
&e.EvmLogParams,
&ed.TokenSymbol,
&ed.TokenType,
&ed.TokenDecimals,
&et.Symbol,
&et.Type,
&et.Decimals,
); err != nil {
return nil, wrapError(err)
}
if ed != (apiTypes.EvmEventDetails{}) {
e.EvmEventDetails = &ed
if et != (apiTypes.EvmEventToken{}) {
e.EvmToken = &et
}
es.Events = append(es.Events, e)
}
Expand Down

0 comments on commit 1c2e9a3

Please sign in to comment.