65408db6e0
I introduced a bug with https://review.dev.storj.io/c/storj/storj/+/2216 Because the log change allowed insert to be called multiple times. This changes the insert logic to do nothing if the PK already exists. Change-Id: I90d192a0f6619bfbb360ea104066f00a3348f6dd
24 lines
713 B
Go
24 lines
713 B
Go
// Copyright (C) 2019 Storj Labs, Inc.
|
|
// See LICENSE for copying information.
|
|
|
|
package satellitedb_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"storj.io/common/testcontext"
|
|
"storj.io/storj/satellite"
|
|
"storj.io/storj/satellite/payments/coinpayments"
|
|
"storj.io/storj/satellite/satellitedb/satellitedbtest"
|
|
)
|
|
|
|
func TestUpdateSameAppliesDoesNotExplode(t *testing.T) {
|
|
satellitedbtest.Run(t, func(ctx *testcontext.Context, t *testing.T, db satellite.DB) {
|
|
tdb := db.StripeCoinPayments().Transactions()
|
|
assert.NoError(t, tdb.Update(ctx, nil, coinpayments.TransactionIDList{"blah", "blah"}))
|
|
assert.NoError(t, tdb.Update(ctx, nil, coinpayments.TransactionIDList{"blah", "blah"}))
|
|
})
|
|
}
|