From fd06a9798daf0145cdef2ecc387ad2649d4bfdd1 Mon Sep 17 00:00:00 2001 From: Elias Van Ootegem Date: Fri, 6 Sep 2024 17:21:24 +0100 Subject: [PATCH] fix: remove reference to public from query Signed-off-by: Elias Van Ootegem --- datanode/sqlstore/volume_discount_stats.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datanode/sqlstore/volume_discount_stats.go b/datanode/sqlstore/volume_discount_stats.go index ce67f42310..4c36b7928a 100644 --- a/datanode/sqlstore/volume_discount_stats.go +++ b/datanode/sqlstore/volume_discount_stats.go @@ -63,7 +63,7 @@ func (s *VolumeDiscountStats) Add(ctx context.Context, stats *entities.VolumeDis } func (s *VolumeDiscountStats) LatestStats(ctx context.Context, partyID string) (entities.VolumeDiscountStats, error) { - query := `SELECT * FROM public.volume_discount_stats WHERE + query := `SELECT * FROM volume_discount_stats WHERE at_epoch = (SELECT id - 1 from current_epochs ORDER BY id DESC, vega_time DESC FETCH FIRST ROW ONLY) AND EXISTS (SELECT TRUE FROM jsonb_array_elements(parties_volume_discount_stats) ps WHERE ps->>'party_id' = '$1')` ent := []entities.VolumeDiscountStats{}