Skip to content

Commit

Permalink
Fix: save addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Oct 31, 2024
1 parent c076515 commit b13d9f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/storage/postgres/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (tx Transaction) SaveAddresses(ctx context.Context, addresses ...*models.Ad
Set("signed_tx_count = added_address.signed_tx_count + EXCLUDED.signed_tx_count").
Set("nonce = GREATEST(EXCLUDED.nonce, added_address.nonce)").
Set("is_bridge = EXCLUDED.is_bridge OR added_address.is_bridge").
Set("is_ibc_relayer = CASE WHEN EXCLUDED.is_ibc_relayer IS NOT NULL THEN EXCLUDED.is_ibc_relayer END").
Set("is_ibc_relayer = CASE WHEN EXCLUDED.is_ibc_relayer IS NOT NULL THEN EXCLUDED.is_ibc_relayer ELSE added_address.is_ibc_relayer END").
Returning("xmax, id").
Exec(ctx)
if err != nil {
Expand Down

0 comments on commit b13d9f0

Please sign in to comment.