Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix event sql query (#1984) #1985

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go/enclave/storage/enclavedb/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ func WriteEventTopic(ctx context.Context, dbTX *sql.Tx, topic *gethcommon.Hash,
return uint64(id), nil
}

func UpdateEventTopicLifecycle(ctx context.Context, dbTx *sql.Tx, etId uint64, isLifecycle bool) error {
_, err := dbTx.ExecContext(ctx, "update event_topic set lifecycle_event=? where id=?", isLifecycle, etId)
func UpdateEventTypeLifecycle(ctx context.Context, dbTx *sql.Tx, etId uint64, isLifecycle bool) error {
_, err := dbTx.ExecContext(ctx, "update event_type set lifecycle_event=? where id=?", isLifecycle, etId)
return err
}

Expand Down
2 changes: 1 addition & 1 deletion go/enclave/storage/events_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (es *eventsStorage) handleEventType(ctx context.Context, dbTX *sql.Tx, l *t
if err == nil {
// in case we determined the current emitted event is not lifecycle, we must update the EventType
if !isLifecycle && et.isLifecycle {
err := enclavedb.UpdateEventTopicLifecycle(ctx, dbTX, et.id, isLifecycle)
err := enclavedb.UpdateEventTypeLifecycle(ctx, dbTX, et.id, isLifecycle)
if err != nil {
return 0, fmt.Errorf("could not update the event type. cause: %w", err)
}
Expand Down