diff --git a/satellite/satellitedb/attribution_test.go b/satellite/console/attribution_test.go similarity index 99% rename from satellite/satellitedb/attribution_test.go rename to satellite/console/attribution_test.go index ffaabd237..53ae83303 100644 --- a/satellite/satellitedb/attribution_test.go +++ b/satellite/console/attribution_test.go @@ -1,7 +1,7 @@ // Copyright (C) 2019 Storj Labs, Inc. // See LICENSE for copying information. -package satellitedb_test +package console_test import ( "testing" diff --git a/satellite/satellitedb/gracefulexit_test.go b/satellite/gracefulexit/gracefulexit_test.go similarity index 99% rename from satellite/satellitedb/gracefulexit_test.go rename to satellite/gracefulexit/gracefulexit_test.go index d46cf821c..cbd108e80 100644 --- a/satellite/satellitedb/gracefulexit_test.go +++ b/satellite/gracefulexit/gracefulexit_test.go @@ -1,7 +1,7 @@ // Copyright (C) 2019 Storj Labs, Inc. // See LICENSE for copying information. -package satellitedb_test +package gracefulexit_test import ( "math/rand" diff --git a/satellite/satellitedb/buckets_test.go b/satellite/metainfo/bucketsdb_test.go similarity index 99% rename from satellite/satellitedb/buckets_test.go rename to satellite/metainfo/bucketsdb_test.go index 2e3cfa6bc..8a328ff18 100644 --- a/satellite/satellitedb/buckets_test.go +++ b/satellite/metainfo/bucketsdb_test.go @@ -1,7 +1,7 @@ // Copyright (C) 2020 Storj Labs, Inc. // See LICENSE for copying information. -package satellitedb_test +package metainfo_test import ( "bytes" diff --git a/satellite/satellitedb/overlaycache_test.go b/satellite/overlay/db_test.go similarity index 95% rename from satellite/satellitedb/overlaycache_test.go rename to satellite/overlay/db_test.go index 28154821d..5fa90407b 100644 --- a/satellite/satellitedb/overlaycache_test.go +++ b/satellite/overlay/db_test.go @@ -1,7 +1,7 @@ // Copyright (C) 2020 Storj Labs, Inc. // See LICENSE for copying information. -package satellitedb_test +package overlay_test import ( "fmt" @@ -186,13 +186,3 @@ func TestOperatorConfig(t *testing.T) { } }) } - -// returns an AuditHistoryConfig with sensible test values. -func testAuditHistoryConfig() overlay.AuditHistoryConfig { - return overlay.AuditHistoryConfig{ - WindowSize: time.Hour, - TrackingPeriod: time.Hour, - GracePeriod: time.Hour, - OfflineThreshold: 0, - } -} diff --git a/satellite/payments/coinpayments/transactions_test.go b/satellite/payments/coinpayments/transactions_test.go index 14e5a6993..b55a635b8 100644 --- a/satellite/payments/coinpayments/transactions_test.go +++ b/satellite/payments/coinpayments/transactions_test.go @@ -1,7 +1,7 @@ // Copyright (C) 2020 Storj Labs, Inc. // See LICENSE for copying information. -package coinpayments +package coinpayments_test import ( "math/big" @@ -10,6 +10,9 @@ import ( "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 TestListInfos(t *testing.T) { @@ -18,24 +21,24 @@ func TestListInfos(t *testing.T) { ctx := testcontext.New(t) defer ctx.Cleanup() - payments := NewClient(Credentials{ + payments := coinpayments.NewClient(coinpayments.Credentials{ PublicKey: "ask-littleskunk-on-keybase", PrivateKey: "ask-littleskunk-on-keybase", }).Transactions() // verify that bad ids fail - infos, err := payments.ListInfos(ctx, TransactionIDList{"an_unlikely_id"}) + infos, err := payments.ListInfos(ctx, coinpayments.TransactionIDList{"an_unlikely_id"}) assert.Error(t, err) assert.Len(t, infos, 0) // verify that ListInfos can handle more than 25 good ids - ids := TransactionIDList{} + ids := coinpayments.TransactionIDList{} for x := 0; x < 27; x++ { tx, err := payments.Create(ctx, - &CreateTX{ + &coinpayments.CreateTX{ Amount: *big.NewFloat(100), - CurrencyIn: CurrencySTORJ, - CurrencyOut: CurrencySTORJ, + CurrencyIn: coinpayments.CurrencySTORJ, + CurrencyOut: coinpayments.CurrencySTORJ, BuyerEmail: "test@test.com", }, ) @@ -46,3 +49,11 @@ func TestListInfos(t *testing.T) { assert.NoError(t, err) assert.Len(t, infos, 27) } + +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"})) + }) +} diff --git a/satellite/satellitedb/revocation_test.go b/satellite/revocation/revocation_test.go similarity index 98% rename from satellite/satellitedb/revocation_test.go rename to satellite/revocation/revocation_test.go index d70ccaf54..b4ec41418 100644 --- a/satellite/satellitedb/revocation_test.go +++ b/satellite/revocation/revocation_test.go @@ -1,7 +1,7 @@ // Copyright (C) 2020 Storj Labs, Inc. // See LICENSE for copying information. -package satellitedb_test +package revocation_test import ( "testing" diff --git a/satellite/satellitedb/buckets.go b/satellite/satellitedb/bucketsdb.go similarity index 100% rename from satellite/satellitedb/buckets.go rename to satellite/satellitedb/bucketsdb.go diff --git a/satellite/satellitedb/coinpaymentstxs_test.go b/satellite/satellitedb/coinpaymentstxs_test.go deleted file mode 100644 index df1f7f3db..000000000 --- a/satellite/satellitedb/coinpaymentstxs_test.go +++ /dev/null @@ -1,23 +0,0 @@ -// 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"})) - }) -}