Skip to content

Commit

Permalink
fix null txorigin error (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
iostream1308 authored Feb 17, 2025
1 parent 4fd460c commit cf66911
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion internal/worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ func (w *Worker) processMessages(m []evmlistenerclient.Message) error {
w.l.Errorw("error when get tx origin", "txHash", order.TxHash, "err", err)
}
if txOrigin != (common.Address{}) {
order.TxOrigin = strings.ToLower(txOrigin.Hex())
order.TxOrigin = new(string)
*order.TxOrigin = strings.ToLower(txOrigin.Hex())
}
insertOrders = append(insertOrders, order)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type TradeLog struct {
LogIndex uint64 `db:"log_index" json:"log_index,omitempty"`
Timestamp uint64 `db:"timestamp" json:"timestamp,omitempty"`
EventHash string `db:"event_hash" json:"event_hash,omitempty"`
TxOrigin string `db:"tx_origin" json:"tx_origin,omitempty"`
TxOrigin *string `db:"tx_origin" json:"tx_origin,omitempty"`
MakerTraits string `db:"maker_traits" json:"maker_traits,omitempty"`
Expiry uint64 `db:"expiration_date" json:"expiration_date"`
MakerTokenPrice float64 `db:"maker_token_price" json:"maker_token_price"`
Expand Down

0 comments on commit cf66911

Please sign in to comment.