Skip to content

Commit

Permalink
satellite/console: use storj bonus txn.ID as PaymentInfo.ID
Browse files Browse the repository at this point in the history
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 #6764

Change-Id: I6edabbe25e1e76a64e949fd02a1fd982a677a226
  • Loading branch information
cam-a authored and Storj Robot committed Feb 23, 2024
1 parent 631bcc4 commit a39dabf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion satellite/console/service.go
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion satellite/console/service_test.go
Expand Up @@ -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,
Expand Down

0 comments on commit a39dabf

Please sign in to comment.