Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew7234 committed Jan 12, 2023
1 parent 9b279c3 commit d387207
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion api/v1/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ func (c *storageClient) Transaction(ctx context.Context, r *http.Request) (*apiT
}

// Events returns a list of events.
func (c *storageClient) Events(ctx context.Context, r *http.Request) (*apiTypes.EventsList, error) {
func (c *storageClient) Events(ctx context.Context, r *http.Request) (*apiTypes.ConsensusEventList, error) {
var q storage.EventsRequest

params := r.URL.Query()
Expand Down
2 changes: 1 addition & 1 deletion api/v1/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func (h *Handler) ListEvents(w http.ResponseWriter, r *http.Request) {
w.Header().Set("content-type", "application/json")
if _, err := w.Write(resp); err != nil {
h.logger.Error("failed to write response",
"request_id", ctx.Value(storage.RequestIDContextKey),
"request_id", ctx.Value(common.RequestIDContextKey),
"error", err,
)
h.metrics.RequestCounter(r.URL.Path, "failure", "http_error").Inc()
Expand Down
12 changes: 2 additions & 10 deletions storage/client/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,10 @@ type TransactionList = api.TransactionList
type Transaction = api.Transaction

// EventsList is the storage response for ListEvents.
type EventsList struct {
Events []Event `json:"events"`
}
type EventList = api.ConsensusEventList

// Event is a consensus event.
type Event struct {
Height int64 `json:"height"`
TxIndex *int32 `json:"tx_index,omitempty"`
TxHash *string `json:"hash,omitempty"`
Type string `json:"type"`
Body []byte `json:"body"`
}
type Event = api.ConsensusEvent

// EntityList is the storage response for ListEntities.
type EntityList = api.EntityList
Expand Down

0 comments on commit d387207

Please sign in to comment.