From 6a4bc5b96e7bf62dcaaf8e79c11249bd5bde9c51 Mon Sep 17 00:00:00 2001 From: Matt <98158711+BedrockSquirrel@users.noreply.github.com> Date: Tue, 9 Jul 2024 12:28:29 +0200 Subject: [PATCH] Fix event sql query (#1984) --- go/enclave/storage/enclavedb/events.go | 4 ++-- go/enclave/storage/events_storage.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go/enclave/storage/enclavedb/events.go b/go/enclave/storage/enclavedb/events.go index ba00c39ee2..f5a505bbc8 100644 --- a/go/enclave/storage/enclavedb/events.go +++ b/go/enclave/storage/enclavedb/events.go @@ -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 } diff --git a/go/enclave/storage/events_storage.go b/go/enclave/storage/events_storage.go index 20370589ff..84e7859901 100644 --- a/go/enclave/storage/events_storage.go +++ b/go/enclave/storage/events_storage.go @@ -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) }