From f880644c6e118b834145fd7c19fd37f2e6089435 Mon Sep 17 00:00:00 2001 From: Geoffrey Ragot Date: Thu, 14 Nov 2024 10:14:43 +0100 Subject: [PATCH] fix: missing hash in log list --- internal/README.md | 2 +- internal/log.go | 2 +- test/e2e/api_logs_list_test.go | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/README.md b/internal/README.md index 9bd9a8d20..99da8b3f7 100644 --- a/internal/README.md +++ b/internal/README.md @@ -546,7 +546,7 @@ type Log struct { // It allows to check if the usage of IdempotencyKey match inputs given on the first idempotency key usage. IdempotencyHash string `json:"idempotencyHash" bun:"idempotency_hash,unique,nullzero"` ID int `json:"id" bun:"id,unique,type:numeric"` - Hash []byte `json:"hash" bun:"hash,type:bytea,scanonly"` + Hash []byte `json:"hash" bun:"hash,type:bytea"` } ``` diff --git a/internal/log.go b/internal/log.go index d611e3a9e..e5efc5980 100644 --- a/internal/log.go +++ b/internal/log.go @@ -91,7 +91,7 @@ type Log struct { // It allows to check if the usage of IdempotencyKey match inputs given on the first idempotency key usage. IdempotencyHash string `json:"idempotencyHash" bun:"idempotency_hash,unique,nullzero"` ID int `json:"id" bun:"id,unique,type:numeric"` - Hash []byte `json:"hash" bun:"hash,type:bytea,scanonly"` + Hash []byte `json:"hash" bun:"hash,type:bytea"` } func (l Log) WithIdempotencyKey(key string) Log { diff --git a/test/e2e/api_logs_list_test.go b/test/e2e/api_logs_list_test.go index 59183f74e..0d2d93a8c 100644 --- a/test/e2e/api_logs_list_test.go +++ b/test/e2e/api_logs_list_test.go @@ -134,6 +134,10 @@ var _ = Context("Ledger logs list API tests", func() { Expect(response.Data).To(HaveLen(3)) + for _, data := range response.Data { + Expect(data.Hash).NotTo(BeEmpty()) + } + // Cannot check the date and the hash since they are changing at // every run Expect(response.Data[0].ID).To(Equal(big.NewInt(3)))