Skip to content

Commit

Permalink
Add comment for converting json bytes to string
Browse files Browse the repository at this point in the history
  • Loading branch information
urvisavla committed Nov 13, 2023
1 parent 982d153 commit 9382057
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions services/horizon/internal/db2/history/liquidity_pools.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ type LiquidityPool struct {
type LiquidityPoolAssetReserves []LiquidityPoolAssetReserve

func (c LiquidityPoolAssetReserves) Value() (driver.Value, error) {
// Convert the byte array into a string as a workaround to bypass buggy encoding in the pq driver
// (More info about this bug here https://github.com/stellar/go/issues/5086#issuecomment-1773215436).
val, err := json.Marshal(c)
return string(val), err
}
Expand Down

0 comments on commit 9382057

Please sign in to comment.