diff --git a/pkg/solana/logpoller/orm.go b/pkg/solana/logpoller/orm.go index d17538d59..b9daec231 100644 --- a/pkg/solana/logpoller/orm.go +++ b/pkg/solana/logpoller/orm.go @@ -58,8 +58,6 @@ func (o *DSORM) InsertFilter(ctx context.Context, filter Filter) (id int64, err INSERT INTO solana.log_poller_filters (chain_id, name, address, event_name, event_sig, starting_block, event_idl, subkey_paths, retention, max_logs_kept) VALUES (:chain_id, :name, :address, :event_name, :event_sig, :starting_block, :event_idl, :subkey_paths, :retention, :max_logs_kept) - ON CONFLICT (solana.f_log_poller_filter_hash(name, chain_id, address, event_sig, subkey_paths)) - DO UPDATE SET retention=:retention ::::BIGINT, max_logs_kept=:max_logs_kept ::::NUMERIC, starting_block=:starting_block ::::NUMERIC RETURNING id;` query, sqlArgs, err := o.ds.BindNamed(query, args) diff --git a/pkg/solana/logpoller/orm_test.go b/pkg/solana/logpoller/orm_test.go index 9eac6f97c..09c91c5c7 100644 --- a/pkg/solana/logpoller/orm_test.go +++ b/pkg/solana/logpoller/orm_test.go @@ -76,23 +76,9 @@ func TestLogPollerFilters(t *testing.T) { dbFilter, err := orm.GetFilterByID(ctx, id) require.NoError(t, err) require.Equal(t, filter, dbFilter) - - // subsequent insert of the same filter won't produce new db row - secondID, err := orm.InsertFilter(ctx, filter) - require.NoError(t, err) - require.Equal(t, secondID, id) }) } }) - t.Run("Subsequent insert does not produce a new id", func(t *testing.T) { - filter := newRandomFilter(t) - ctx := tests.Context(t) - firstID, err := orm.InsertFilter(ctx, filter) - require.NoError(t, err) - secondID, err := orm.InsertFilter(ctx, filter) - require.NoError(t, err) - require.Equal(t, firstID, secondID) - }) t.Run("Returns and error if name is not unique", func(t *testing.T) { filter := newRandomFilter(t) ctx := tests.Context(t)