Skip to content

Commit

Permalink
api: add related runtime and round fields to consensus events
Browse files Browse the repository at this point in the history
  • Loading branch information
pro-wh committed Jan 3, 2024
1 parent 074327e commit 66c1cb2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions api/spec/v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1581,6 +1581,11 @@ components:
Hash of this event's originating transaction.
Absent if the event did not originate from a transaction.
example: *tx_hash_1
related_runtime:
type: string
related_runtime_round:
type: integer
format: int64
type:
description: The type of the event.
$ref: '#/components/schemas/ConsensusEventType'
Expand Down
2 changes: 1 addition & 1 deletion storage/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ func (c *StorageClient) Events(ctx context.Context, p apiTypes.GetConsensusEvent

for res.rows.Next() {
var e Event
if err := res.rows.Scan(&e.Block, &e.TxIndex, &e.TxHash, &e.Type, &e.Body); err != nil {
if err := res.rows.Scan(&e.Block, &e.TxIndex, &e.TxHash, &e.RelatedRuntime, &e.RelatedRuntimeRound, &e.Type, &e.Body); err != nil {
return nil, wrapError(err)
}
es.Events = append(es.Events, e)
Expand Down
2 changes: 1 addition & 1 deletion storage/client/queries/queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const (
WHERE tx_hash = $1::text`

Events = `
SELECT tx_block, tx_index, tx_hash, type, body
SELECT tx_block, tx_index, tx_hash, related_runtime, related_runtime_round, type, body
FROM chain.events
WHERE ($1::bigint IS NULL OR tx_block = $1::bigint) AND
($2::integer IS NULL OR tx_index = $2::integer) AND
Expand Down

0 comments on commit 66c1cb2

Please sign in to comment.