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: missing hash in log list #563

Merged
merged 1 commit into from
Nov 14, 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
2 changes: 1 addition & 1 deletion internal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
```

Expand Down
2 changes: 1 addition & 1 deletion internal/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions test/e2e/api_logs_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down
Loading