From a39dabf39114e550f8f093dc6596858f4b53c562 Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 22 Feb 2024 15:44:10 -0500 Subject: [PATCH] satellite/console: use storj bonus txn.ID as PaymentInfo.ID Use ID instead of meta.ReferenceID and meta.LogIndex as PaymentInfo.ID when getting storj bonus information to ensure IDs are unique. The storj bonus ReferenceID and LogIndex are identical to the storjscan_payments transaction hex and log index for which the bonus was given, resulting in identical PaymentInfo.IDs. These duplicate IDs caused duplication of rows in the UI transaction table. addresses AC #2 in https://github.com/storj/storj/issues/6764 Change-Id: I6edabbe25e1e76a64e949fd02a1fd982a677a226 --- satellite/console/service.go | 2 +- satellite/console/service_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/satellite/console/service.go b/satellite/console/service.go index 6642c014910a..c1fb9b61d21a 100644 --- a/satellite/console/service.go +++ b/satellite/console/service.go @@ -3598,7 +3598,7 @@ func (payment Payments) WalletPayments(ctx context.Context) (_ WalletPayments, e return WalletPayments{}, Error.Wrap(err) } paymentInfos = append(paymentInfos, PaymentInfo{ - ID: fmt.Sprintf("%s#%d", meta.ReferenceID, meta.LogIndex), + ID: fmt.Sprint(txn.ID), Type: txn.Source, Wallet: address.Hex(), Amount: txn.Amount, diff --git a/satellite/console/service_test.go b/satellite/console/service_test.go index a736b28e156d..83fb67c2294b 100644 --- a/satellite/console/service_test.go +++ b/satellite/console/service_test.go @@ -2140,7 +2140,7 @@ func TestPaymentsWalletPayments(t *testing.T) { require.NoError(t, err) expected = append(expected, console.PaymentInfo{ - ID: fmt.Sprintf("%s#%d", meta.ReferenceID, meta.LogIndex), + ID: fmt.Sprint(txn.ID), Type: txn.Source, Wallet: meta.Wallet, Amount: txn.Amount,