all: switch to storj.io/common/uuid

Change-Id: I178a0a8dac691e57bce317b91411292fb3c40c9f
This commit is contained in:
Egon Elbre 2020-03-30 12:08:50 +03:00
parent 1d79228ed0
commit 0a69da4ff1
117 changed files with 246 additions and 253 deletions

View File

@ -12,7 +12,6 @@ import (
"text/tabwriter"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/spf13/cobra"
"github.com/zeebo/errs"
"go.uber.org/zap"
@ -20,6 +19,7 @@ import (
"storj.io/common/context2"
"storj.io/common/fpath"
"storj.io/common/storj"
"storj.io/common/uuid"
"storj.io/private/cfgstruct"
"storj.io/private/process"
"storj.io/private/version"

View File

@ -12,11 +12,11 @@ import (
"strconv"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/zeebo/errs"
"go.uber.org/zap"
"storj.io/common/memory"
"storj.io/common/uuid"
"storj.io/storj/private/dbutil"
"storj.io/storj/satellite/attribution"
"storj.io/storj/satellite/satellitedb"

View File

@ -18,7 +18,6 @@ import (
"time"
"github.com/gogo/protobuf/proto"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@ -26,6 +25,7 @@ import (
"storj.io/common/storj"
"storj.io/common/testcontext"
"storj.io/common/testrand"
"storj.io/common/uuid"
"storj.io/storj/satellite/metainfo"
"storj.io/storj/storage"
"storj.io/storj/storage/teststore"
@ -114,7 +114,7 @@ func TestObserver_processSegment(t *testing.T) {
var (
bucketName = "test-bucket"
projectID = testrand.UUID()
projectID = testrand.UUID2()
numSegments = 65
obsvr = observer{
objects: make(bucketsObjects),
@ -155,7 +155,7 @@ func TestObserver_processSegment(t *testing.T) {
var (
bucketName = "test-bucket"
projectID = testrand.UUID()
projectID = testrand.UUID2()
numSegments = 65
obsvr = observer{
objects: make(bucketsObjects),
@ -223,7 +223,7 @@ func TestObserver_processSegment(t *testing.T) {
to = time.Now()
from = to.Add(-time.Hour)
bucketName = "test-bucket"
projectID = testrand.UUID()
projectID = testrand.UUID2()
obsvr = observer{
objects: make(bucketsObjects),
from: &from,
@ -262,7 +262,7 @@ func TestObserver_processSegment(t *testing.T) {
from = to.Add(-2 * time.Hour)
diffFromTo = to.Sub(from)
bucketName = "test-bucket"
projectID = testrand.UUID()
projectID = testrand.UUID2()
numSegmentsObjOutDateRange = rand.Intn(50) + 15
numSegmentsBeforeDate = rand.Intn(numSegmentsObjOutDateRange-1) + 1
obsvr = observer{
@ -342,7 +342,7 @@ func TestObserver_processSegment(t *testing.T) {
to = time.Now()
from = to.Add(-time.Hour)
bucketName = "test-bucket"
projectID = testrand.UUID()
projectID = testrand.UUID2()
obsvr = observer{
objects: make(bucketsObjects),
from: &from,
@ -381,7 +381,7 @@ func TestObserver_processSegment(t *testing.T) {
from = to.Add(-2 * time.Hour)
diffFromTo = to.Sub(from)
bucketName = "test-bucket"
projectID = testrand.UUID()
projectID = testrand.UUID2()
numSegmentsObjOutDateRange = rand.Intn(50) + 15
numSegmentsBeforeDate = rand.Intn(numSegmentsObjOutDateRange-1) + 1
obsvr = observer{
@ -499,7 +499,7 @@ func TestObserver_processSegment_from_to(t *testing.T) {
to: to,
}
path := metainfo.ScopedPath{
ProjectID: testrand.UUID(),
ProjectID: testrand.UUID2(),
Segment: "l",
BucketName: "bucket1",
EncryptedObjectPath: "path1",
@ -570,7 +570,7 @@ func TestObserver_processSegment_single_project(t *testing.T) {
expected string
}
project1 := testrand.UUID().String()
project1 := testrand.UUID2().String()
tests := []struct {
objects []object
}{
@ -725,7 +725,7 @@ func TestObserver_analyzeProject(t *testing.T) {
observer := &observer{
objects: bucketObjects,
lastProjectID: testrand.UUID().String(),
lastProjectID: testrand.UUID2().String(),
zombieBuffer: make([]int, 0, maxNumOfSegments),
}
err := observer.findZombieSegments(object)
@ -768,7 +768,7 @@ func createNewObjectSegments(
t.Helper()
var (
objectID = testrand.UUID().String()
objectID = testrand.UUID2().String()
projectIDString = projectID.String()
references = make([]segmentRef, 0, numSegments)
encryptedPath = fmt.Sprintf("%s-%s-%s", projectIDString, bucketName, objectID)
@ -864,7 +864,7 @@ func generateTestdataObjects(
}
bucketName = "0"
numObjs = rand.Intn(10) + 2
projID = testrand.UUID()
projID = testrand.UUID2()
withoutLastSegmentCount = 0
withMoreThanMaxNumSegmentsCount = 0
numMaxGeneratedSegments = 10

View File

@ -15,9 +15,9 @@ import (
"net/http"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/zeebo/errs"
"storj.io/common/uuid"
"storj.io/storj/satellite/console/consoleauth"
)

3
go.mod
View File

@ -27,7 +27,6 @@ require (
github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d
github.com/shopspring/decimal v0.0.0-20200105231215-408a2507e114
github.com/sirupsen/logrus v1.4.2 // indirect
github.com/skyrings/skyring-common v0.0.0-20160929130248-d1c0bb1cbd5e
github.com/spacemonkeygo/monkit/v3 v3.0.5
github.com/spf13/cast v1.3.0
github.com/spf13/cobra v0.0.6
@ -44,7 +43,7 @@ require (
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5
golang.org/x/time v0.0.0-20191024005414-555d28b269f0
google.golang.org/grpc v1.28.0
storj.io/common v0.0.0-20200325130515-1ce63718a5c6
storj.io/common v0.0.0-20200331124657-a4f8265946f2
storj.io/drpc v0.0.11
storj.io/private v0.0.0-20200327035409-e9d82e7e0c6b
storj.io/uplink v1.0.2-0.20200325131054-76ecb3d2e025

2
go.sum
View File

@ -622,6 +622,8 @@ storj.io/common v0.0.0-20200323134045-2bd4d6e2dd7d h1:R4qel+wubcKJP8HvWromOGOplb
storj.io/common v0.0.0-20200323134045-2bd4d6e2dd7d/go.mod h1:I0QTs7z1rI+ZEN95GGY2LKMzP5OZqu0Udga3WhyQfO0=
storj.io/common v0.0.0-20200325130515-1ce63718a5c6 h1:oyYoBs5GofkCHt/F24uJMzkGpQOoJkp3TYdTVghsUAo=
storj.io/common v0.0.0-20200325130515-1ce63718a5c6/go.mod h1:RBaNRmk/lqyZ7h1MAH4N9zld0z+tO4M9sLOFT30K+cE=
storj.io/common v0.0.0-20200331124657-a4f8265946f2 h1:Fctei5lPPAfbvtpijLQZTjQeeuh+MCkacLYau7nyxKA=
storj.io/common v0.0.0-20200331124657-a4f8265946f2/go.mod h1:RBaNRmk/lqyZ7h1MAH4N9zld0z+tO4M9sLOFT30K+cE=
storj.io/drpc v0.0.7-0.20191115031725-2171c57838d2/go.mod h1:/ascUDbzNAv0A3Jj7wUIKFBH2JdJ2uJIBO/b9+2yHgQ=
storj.io/drpc v0.0.11 h1:6vLxfpSbwCLtqzAoXzXx/SxBqBtbzbmquXPqfcWKqfw=
storj.io/drpc v0.0.11/go.mod h1:TiFc2obNjL9/3isMW1Rpxjy8V9uE0B2HMeMFGiiI7Iw=

View File

@ -9,7 +9,6 @@ import (
"testing"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"
@ -18,6 +17,7 @@ import (
"storj.io/common/storj"
"storj.io/common/testcontext"
"storj.io/common/testrand"
"storj.io/common/uuid"
"storj.io/storj/lib/uplink"
"storj.io/storj/private/testplanet"
)
@ -69,7 +69,7 @@ func TestBucket_PartnerAttribution(t *testing.T) {
apikey, err := uplink.ParseAPIKey(planet.Uplinks[0].APIKey[satellite.ID()].Serialize())
require.NoError(t, err)
partnerID := testrand.UUID()
partnerID := testrand.UUID2()
t.Run("without partner id", func(t *testing.T) {
config := uplink.Config{}
@ -120,7 +120,7 @@ func TestBucket_PartnerAttribution(t *testing.T) {
config := uplink.Config{}
config.Volatile.Log = zaptest.NewLogger(t)
config.Volatile.TLS.SkipPeerCAWhitelist = true
config.Volatile.PartnerID = testrand.UUID().String()
config.Volatile.PartnerID = testrand.UUID2().String()
up, err := uplink.NewUplink(ctx, &config)
require.NoError(t, err)
@ -202,7 +202,7 @@ func TestBucket_UserAgent(t *testing.T) {
require.NoError(t, err)
partnerID, err := uuid.Parse("8cd605fa-ad00-45b6-823e-550eddc611d6")
require.NoError(t, err)
assert.Equal(t, *partnerID, bucketInfo.PartnerID)
assert.Equal(t, storj.DeprecatedUUID(*partnerID), bucketInfo.PartnerID)
})
t.Run("open with different user agent", func(t *testing.T) {
@ -227,7 +227,7 @@ func TestBucket_UserAgent(t *testing.T) {
require.NoError(t, err)
partnerID, err := uuid.Parse("8cd605fa-ad00-45b6-823e-550eddc611d6")
require.NoError(t, err)
assert.Equal(t, *partnerID, bucketInfo.PartnerID)
assert.Equal(t, storj.DeprecatedUUID(*partnerID), bucketInfo.PartnerID)
})
})
}

View File

@ -6,12 +6,11 @@ package uplink
import (
"context"
"github.com/skyrings/skyring-common/tools/uuid"
"storj.io/common/encryption"
"storj.io/common/memory"
"storj.io/common/rpc"
"storj.io/common/storj"
"storj.io/common/uuid"
"storj.io/uplink/private/ecclient"
"storj.io/uplink/private/metainfo"
"storj.io/uplink/private/metainfo/kvmetainfo"
@ -108,7 +107,7 @@ func (p *Project) CreateBucket(ctx context.Context, name string, cfg *BucketConf
}
bucket = storj.Bucket{
PartnerID: partnerID,
PartnerID: storj.DeprecatedUUID(partnerID),
PathCipher: cfg.PathCipher,
DefaultEncryptionParameters: cfg.EncryptionParameters,
DefaultRedundancyScheme: cfg.Volatile.RedundancyScheme,
@ -242,6 +241,6 @@ func (p *Project) trySetBucketAttribution(ctx context.Context, bucketName string
// UserAgent is sent via RequestHeader
return p.metainfo.SetBucketAttribution(ctx, metainfo.SetBucketAttributionParams{
Bucket: bucketName,
PartnerID: partnerID,
PartnerID: storj.DeprecatedUUID(partnerID),
})
}

View File

@ -8,7 +8,6 @@ import "C"
import (
"fmt"
"time"
"storj.io/common/memory"

View File

@ -4,8 +4,9 @@
package dbutil
import (
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/zeebo/errs"
"storj.io/common/uuid"
)
// BytesToUUID is used to convert []byte to UUID.

View File

@ -23,7 +23,7 @@ func TestBytesToUUID(t *testing.T) {
})
t.Run("Valid input", func(t *testing.T) {
id := testrand.UUID()
id := testrand.UUID2()
result, err := BytesToUUID(id[:])
assert.NoError(t, err)
assert.Equal(t, result, id)

View File

@ -79,7 +79,7 @@ func (planet *Planet) newReferralManager() (*server.Server, error) {
func (server *DefaultReferralManagerServer) GetTokens(ctx context.Context, req *pb.GetTokensRequest) (*pb.GetTokensResponse, error) {
tokens := make([][]byte, server.tokenCount)
for i := 0; i < server.tokenCount; i++ {
uuid := testrand.UUID()
uuid := testrand.UUID2()
tokens[i] = uuid[:]
}
return &pb.GetTokensResponse{

View File

@ -12,7 +12,6 @@ import (
"strconv"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/spf13/pflag"
"github.com/zeebo/errs"
"go.uber.org/zap"
@ -23,6 +22,7 @@ import (
"storj.io/common/peertls/tlsopts"
"storj.io/common/rpc"
"storj.io/common/storj"
"storj.io/common/uuid"
"storj.io/private/cfgstruct"
libuplink "storj.io/storj/lib/uplink"
"storj.io/storj/satellite/console"

View File

@ -8,7 +8,6 @@ import (
"testing"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/stretchr/testify/require"
"go.uber.org/zap"
@ -17,6 +16,7 @@ import (
"storj.io/common/storj"
"storj.io/common/testcontext"
"storj.io/common/testrand"
"storj.io/common/uuid"
"storj.io/storj/private/testplanet"
"storj.io/storj/satellite"
"storj.io/storj/satellite/accounting"

View File

@ -4,7 +4,7 @@
package accounting
import (
"github.com/skyrings/skyring-common/tools/uuid"
"storj.io/common/uuid"
)
// BucketTally contains information about aggregate data stored in a bucket

View File

@ -6,7 +6,7 @@ package accounting
import (
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"storj.io/common/uuid"
)
// BucketStorageTally holds data about a bucket tally

View File

@ -7,10 +7,9 @@ import (
"context"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"storj.io/common/memory"
"storj.io/common/storj"
"storj.io/common/uuid"
"storj.io/storj/satellite/compensation"
)

View File

@ -9,7 +9,6 @@ import (
"testing"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@ -17,6 +16,7 @@ import (
"storj.io/common/storj"
"storj.io/common/testcontext"
"storj.io/common/testrand"
"storj.io/common/uuid"
"storj.io/storj/satellite"
"storj.io/storj/satellite/accounting"
"storj.io/storj/satellite/console"
@ -26,7 +26,7 @@ import (
func TestSaveBucketTallies(t *testing.T) {
satellitedbtest.Run(t, func(ctx *testcontext.Context, t *testing.T, db satellite.DB) {
// Setup: create bucket storage tallies
projectID := testrand.UUID()
projectID := testrand.UUID2()
bucketTallies, expectedTallies, err := createBucketStorageTallies(projectID)
require.NoError(t, err)
@ -136,7 +136,7 @@ func TestStorageNodeUsage(t *testing.T) {
func TestProjectLimits(t *testing.T) {
satellitedbtest.Run(t, func(ctx *testcontext.Context, t *testing.T, db satellite.DB) {
proj, err := db.Console().Projects().Insert(ctx, &console.Project{Name: "test", OwnerID: testrand.UUID()})
proj, err := db.Console().Projects().Insert(ctx, &console.Project{Name: "test", OwnerID: testrand.UUID2()})
require.NoError(t, err)
err = db.ProjectAccounting().UpdateProjectUsageLimit(ctx, proj.ID, 1)

View File

@ -8,7 +8,6 @@ import (
"math/rand"
"testing"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"
@ -16,6 +15,7 @@ import (
"storj.io/common/testcontext"
"storj.io/common/testrand"
"storj.io/common/uuid"
"storj.io/storj/satellite/accounting"
"storj.io/storj/satellite/accounting/live"
"storj.io/storj/storage/redis/redisserver"
@ -85,7 +85,7 @@ func TestRedisCacheConcurrency(t *testing.T) {
cache, err := live.NewCache(zaptest.NewLogger(t).Named("live-accounting"), config)
require.NoError(t, err)
projectID := testrand.UUID()
projectID := testrand.UUID2()
const (
numConcurrent = 100
@ -123,7 +123,7 @@ func populateCache(ctx context.Context, cache accounting.Cache) (projectIDs []uu
// make up some project IDs
projectIDs = make([]uuid.UUID, numProjects)
for i := range projectIDs {
projectIDs[i] = testrand.UUID()
projectIDs[i] = testrand.UUID2()
}
// send lots of space used updates for all of these projects to the live
@ -179,7 +179,7 @@ func TestGetAllProjectTotals(t *testing.T) {
projectIDs := make([]uuid.UUID, 1000)
for i := range projectIDs {
projectIDs[i] = testrand.UUID()
projectIDs[i] = testrand.UUID2()
err := cache.AddProjectStorageUsage(ctx, projectIDs[i], int64(i))
require.NoError(t, err)
}

View File

@ -7,9 +7,9 @@ import (
"context"
"strconv"
"github.com/skyrings/skyring-common/tools/uuid"
"go.uber.org/zap"
"storj.io/common/uuid"
"storj.io/storj/storage"
"storj.io/storj/storage/redis"
)

View File

@ -7,12 +7,12 @@ import (
"context"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/spacemonkeygo/monkit/v3"
"github.com/zeebo/errs"
"golang.org/x/sync/errgroup"
"storj.io/common/memory"
"storj.io/common/uuid"
)
var mon = monkit.Package()

View File

@ -11,7 +11,6 @@ import (
"testing"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/zeebo/errs"
@ -26,6 +25,7 @@ import (
"storj.io/common/sync2"
"storj.io/common/testcontext"
"storj.io/common/testrand"
"storj.io/common/uuid"
"storj.io/storj/private/testplanet"
"storj.io/storj/satellite"
"storj.io/storj/satellite/accounting"
@ -208,7 +208,7 @@ func createBucketBandwidthRollups(ctx *testcontext.Context, satelliteDB satellit
func TestProjectBandwidthTotal(t *testing.T) {
satellitedbtest.Run(t, func(ctx *testcontext.Context, t *testing.T, db satellite.DB) {
pdb := db.ProjectAccounting()
projectID := testrand.UUID()
projectID := testrand.UUID2()
// Setup: create bucket bandwidth rollup records
expectedTotal, err := createBucketBandwidthRollups(ctx, db, projectID)
@ -290,8 +290,8 @@ func TestUsageRollups(t *testing.T) {
now := time.Now()
start := now.Add(tallyInterval * time.Duration(-tallyIntervals))
project1 := testrand.UUID()
project2 := testrand.UUID()
project1 := testrand.UUID2()
project2 := testrand.UUID2()
p1base := binary.BigEndian.Uint64(project1[:8]) >> 48
p2base := binary.BigEndian.Uint64(project2[:8]) >> 48

View File

@ -7,13 +7,13 @@ import (
"context"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/spacemonkeygo/monkit/v3"
"github.com/zeebo/errs"
"go.uber.org/zap"
"storj.io/common/pb"
"storj.io/common/sync2"
"storj.io/common/uuid"
"storj.io/storj/pkg/storj"
"storj.io/storj/satellite/orders"
)

View File

@ -7,7 +7,6 @@ import (
"context"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/spacemonkeygo/monkit/v3"
"github.com/zeebo/errs"
"go.uber.org/zap"
@ -15,6 +14,7 @@ import (
"storj.io/common/pb"
"storj.io/common/storj"
"storj.io/common/sync2"
"storj.io/common/uuid"
"storj.io/storj/satellite/accounting"
"storj.io/storj/satellite/metainfo"
)

View File

@ -8,7 +8,6 @@ import (
"testing"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@ -18,6 +17,7 @@ import (
"storj.io/common/storj"
"storj.io/common/testcontext"
"storj.io/common/testrand"
"storj.io/common/uuid"
"storj.io/storj/private/testplanet"
"storj.io/storj/private/teststorj"
"storj.io/storj/satellite/accounting"

View File

@ -10,9 +10,9 @@ import (
"github.com/gorilla/mux"
"github.com/gorilla/schema"
"github.com/skyrings/skyring-common/tools/uuid"
"storj.io/common/memory"
"storj.io/common/uuid"
)
func (server *Server) getProjectLimit(w http.ResponseWriter, r *http.Request) {

View File

@ -8,8 +8,9 @@ import (
"context"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/zeebo/errs"
"storj.io/common/uuid"
)
// ErrBucketNotAttributed is returned if a requested bucket not attributed(entry not found)

View File

@ -7,13 +7,13 @@ import (
"testing"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"storj.io/common/pb"
"storj.io/common/testcontext"
"storj.io/common/testrand"
"storj.io/common/uuid"
"storj.io/storj/private/dbutil"
"storj.io/storj/satellite"
"storj.io/storj/satellite/accounting"
@ -64,8 +64,8 @@ func (testData *AttributionTestData) init() {
func TestDB(t *testing.T) {
satellitedbtest.Run(t, func(ctx *testcontext.Context, t *testing.T, db satellite.DB) {
attributionDB := db.Attribution()
project1, project2 := testrand.UUID(), testrand.UUID()
partner1, partner2 := testrand.UUID(), testrand.UUID()
project1, project2 := testrand.UUID2(), testrand.UUID2()
partner1, partner2 := testrand.UUID2(), testrand.UUID2()
infos := []*attribution.Info{
{project1, []byte("alpha"), partner1, time.Time{}},
@ -94,14 +94,14 @@ func TestQueryAttribution(t *testing.T) {
satellitedbtest.Run(t, func(ctx *testcontext.Context, t *testing.T, db satellite.DB) {
now := time.Now()
projectID := testrand.UUID()
partnerID := testrand.UUID()
projectID := testrand.UUID2()
partnerID := testrand.UUID2()
alphaBucket := []byte("alpha")
betaBucket := []byte("beta")
testData := []AttributionTestData{
{
name: "new partnerID, projectID, alpha",
partnerID: testrand.UUID(),
partnerID: testrand.UUID2(),
projectID: projectID,
bucketName: alphaBucket,
@ -116,7 +116,7 @@ func TestQueryAttribution(t *testing.T) {
{
name: "partnerID, new projectID, alpha",
partnerID: partnerID,
projectID: testrand.UUID(),
projectID: testrand.UUID2(),
bucketName: alphaBucket,
remoteSize: remoteSize / 2,
@ -129,7 +129,7 @@ func TestQueryAttribution(t *testing.T) {
},
{
name: "new partnerID, projectID, beta",
partnerID: testrand.UUID(),
partnerID: testrand.UUID2(),
projectID: projectID,
bucketName: betaBucket,
@ -144,7 +144,7 @@ func TestQueryAttribution(t *testing.T) {
{
name: "partnerID, new projectID, beta",
partnerID: partnerID,
projectID: testrand.UUID(),
projectID: testrand.UUID2(),
bucketName: betaBucket,
remoteSize: remoteSize / 4,

View File

@ -7,7 +7,7 @@ import (
"context"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"storj.io/common/uuid"
)
// APIKeys is interface for working with api keys store

View File

@ -8,7 +8,7 @@ import (
"encoding/json"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"storj.io/common/uuid"
)
//TODO: change to JWT or Macaroon based auth

View File

@ -13,7 +13,7 @@ import (
)
func TestClaims(t *testing.T) {
id := testrand.UUID()
id := testrand.UUID2()
claims := Claims{
ID: id,

View File

@ -8,10 +8,10 @@ import (
"net/http"
"github.com/gorilla/mux"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/zeebo/errs"
"go.uber.org/zap"
"storj.io/common/uuid"
"storj.io/storj/private/post"
"storj.io/storj/satellite/console"
"storj.io/storj/satellite/console/consoleweb/consoleql"

View File

@ -5,9 +5,9 @@ package consoleql
import (
"github.com/graphql-go/graphql"
"github.com/skyrings/skyring-common/tools/uuid"
"go.uber.org/zap"
"storj.io/common/uuid"
"storj.io/storj/private/post"
"storj.io/storj/satellite/console"
"storj.io/storj/satellite/mailservice"

View File

@ -9,12 +9,12 @@ import (
"testing"
"github.com/graphql-go/graphql"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"
"storj.io/common/testcontext"
"storj.io/common/uuid"
"storj.io/storj/pkg/auth"
"storj.io/storj/private/post"
"storj.io/storj/satellite"

View File

@ -5,8 +5,8 @@ package consoleql
import (
"github.com/graphql-go/graphql"
"github.com/skyrings/skyring-common/tools/uuid"
"storj.io/common/uuid"
"storj.io/storj/satellite/console"
"storj.io/storj/satellite/mailservice"
"storj.io/storj/satellite/rewards"

View File

@ -22,12 +22,12 @@ import (
"github.com/gorilla/mux"
"github.com/graphql-go/graphql"
"github.com/graphql-go/graphql/gqlerrors"
"github.com/skyrings/skyring-common/tools/uuid"
monkit "github.com/spacemonkeygo/monkit/v3"
"github.com/zeebo/errs"
"go.uber.org/zap"
"golang.org/x/sync/errgroup"
"storj.io/common/uuid"
"storj.io/storj/pkg/auth"
"storj.io/storj/satellite/console"
"storj.io/storj/satellite/console/consoleweb/consoleapi"

View File

@ -7,7 +7,7 @@ import (
"context"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"storj.io/common/uuid"
)
// ProjectMembers exposes methods to manage ProjectMembers table in database.

View File

@ -26,7 +26,7 @@ func TestProjectMembersRepository(t *testing.T) {
createdUsers, createdProjects := prepareUsersAndProjects(ctx, t, users, projects)
t.Run("Can't insert projectMember without memberID", func(t *testing.T) {
missingUserID := testrand.UUID()
missingUserID := testrand.UUID2()
projMember, err := projectMembers.Insert(ctx, missingUserID, createdProjects[0].ID)
assert.Nil(t, projMember)
@ -34,7 +34,7 @@ func TestProjectMembersRepository(t *testing.T) {
})
t.Run("Can't insert projectMember without projectID", func(t *testing.T) {
missingProjectID := testrand.UUID()
missingProjectID := testrand.UUID2()
projMember, err := projectMembers.Insert(ctx, createdUsers[0].ID, missingProjectID)
assert.Nil(t, projMember)
@ -156,37 +156,37 @@ func TestProjectMembersRepository(t *testing.T) {
func prepareUsersAndProjects(ctx context.Context, t *testing.T, users console.Users, projects console.Projects) ([]*console.User, []*console.Project) {
usersList := []*console.User{{
ID: testrand.UUID(),
ID: testrand.UUID2(),
Email: "2email2@mail.test",
PasswordHash: []byte("some_readable_hash"),
ShortName: "Liam",
FullName: "Liam Jameson",
}, {
ID: testrand.UUID(),
ID: testrand.UUID2(),
Email: "1email1@mail.test",
PasswordHash: []byte("some_readable_hash"),
ShortName: "William",
FullName: "Noahson William",
}, {
ID: testrand.UUID(),
ID: testrand.UUID2(),
Email: "email3@mail.test",
PasswordHash: []byte("some_readable_hash"),
ShortName: "Mason",
FullName: "Mason Elijahson",
}, {
ID: testrand.UUID(),
ID: testrand.UUID2(),
Email: "email4@mail.test",
PasswordHash: []byte("some_readable_hash"),
ShortName: "Oliver",
FullName: "Oliver Jacobson",
}, {
ID: testrand.UUID(),
ID: testrand.UUID2(),
Email: "email5@mail.test",
PasswordHash: []byte("some_readable_hash"),
ShortName: "Lucas",
FullName: "Michaelson Lucas",
}, {
ID: testrand.UUID(),
ID: testrand.UUID2(),
Email: "email6@mail.test",
PasswordHash: []byte("some_readable_hash"),
ShortName: "Alexander",

View File

@ -7,7 +7,7 @@ import (
"context"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"storj.io/common/uuid"
)
// Projects exposes methods to manage Project table in database.

View File

@ -44,7 +44,7 @@ func TestProjectsRepository(t *testing.T) {
t.Run("Insert project successfully", func(t *testing.T) {
var err error
owner, err = users.Insert(ctx, &console.User{
ID: testrand.UUID(),
ID: testrand.UUID2(),
FullName: userFullName,
ShortName: shortName,
Email: email,
@ -53,7 +53,7 @@ func TestProjectsRepository(t *testing.T) {
require.NoError(t, err)
require.NotNil(t, owner)
owner, err := users.Insert(ctx, &console.User{
ID: testrand.UUID(),
ID: testrand.UUID2(),
FullName: userFullName,
ShortName: shortName,
Email: email,
@ -178,7 +178,7 @@ func TestProjectsList(t *testing.T) {
// create owner
owner, err := db.Console().Users().Insert(ctx,
&console.User{
ID: testrand.UUID(),
ID: testrand.UUID2(),
FullName: "Billy H",
Email: "billyh@example.com",
PasswordHash: []byte("example_password"),

View File

@ -10,8 +10,9 @@ import (
"encoding/base64"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/zeebo/errs"
"storj.io/common/uuid"
)
// RegistrationTokens is interface for working with registration tokens

View File

@ -9,8 +9,9 @@ import (
"encoding/base64"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/zeebo/errs"
"storj.io/common/uuid"
)
// ResetPasswordTokens is interface for working with reset password tokens

View File

@ -35,7 +35,7 @@ func TestNewRegistrationSecret(t *testing.T) {
t.Run("Insert reset password token successfully", func(t *testing.T) {
var err error
owner, err = users.Insert(ctx, &console.User{
ID: testrand.UUID(),
ID: testrand.UUID2(),
FullName: userFullName,
ShortName: shortName,
Email: email,

View File

@ -11,7 +11,6 @@ import (
"sort"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
monkit "github.com/spacemonkeygo/monkit/v3"
"github.com/zeebo/errs"
"go.uber.org/zap"
@ -19,6 +18,7 @@ import (
"storj.io/common/macaroon"
"storj.io/common/memory"
"storj.io/common/uuid"
"storj.io/storj/pkg/auth"
"storj.io/storj/satellite/accounting"
"storj.io/storj/satellite/console/consoleauth"
@ -450,7 +450,7 @@ func (s *Service) CreateUser(ctx context.Context, user CreateUser, tokenSecret R
}
newUser := &User{
ID: *userID,
ID: userID,
Email: user.Email,
FullName: user.FullName,
ShortName: user.ShortName,

View File

@ -7,9 +7,9 @@ import (
"context"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/zeebo/errs"
"storj.io/common/uuid"
"storj.io/storj/private/currency"
"storj.io/storj/satellite/rewards"
)

View File

@ -25,7 +25,7 @@ func TestUserCredits(t *testing.T) {
consoleDB := db.Console()
user, referrer, activeOffer, defaultOffer := setupData(ctx, t, db)
randomID := testrand.UUID()
randomID := testrand.UUID2()
invalidOffer := rewards.Offer{
ID: 10,
}
@ -290,7 +290,7 @@ func setupData(ctx context.Context, t *testing.T, db satellite.DB) (user *consol
// create an user
user, err = consoleDB.Users().Insert(ctx, &console.User{
ID: testrand.UUID(),
ID: testrand.UUID2(),
FullName: "John Doe",
Email: "john@mail.test",
PasswordHash: userPassHash,
@ -300,7 +300,7 @@ func setupData(ctx context.Context, t *testing.T, db satellite.DB) (user *consol
//create an user as referrer
referrer, err = consoleDB.Users().Insert(ctx, &console.User{
ID: testrand.UUID(),
ID: testrand.UUID2(),
FullName: "referrer",
Email: "referrer@mail.test",
PasswordHash: referrerPassHash,

View File

@ -8,7 +8,7 @@ import (
"net/mail"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"storj.io/common/uuid"
)
// Users exposes methods to manage User table in database.

View File

@ -32,11 +32,11 @@ const (
func TestUserRepository(t *testing.T) {
satellitedbtest.Run(t, func(ctx *testcontext.Context, t *testing.T, db satellite.DB) {
repository := db.Console().Users()
partnerID := testrand.UUID()
partnerID := testrand.UUID2()
// Test with and without partnerID
user := &console.User{
ID: testrand.UUID(),
ID: testrand.UUID2(),
FullName: name,
ShortName: lastName,
Email: email,
@ -47,7 +47,7 @@ func TestUserRepository(t *testing.T) {
testUsers(ctx, t, repository, user)
user = &console.User{
ID: testrand.UUID(),
ID: testrand.UUID2(),
FullName: name,
ShortName: lastName,
Email: email,
@ -72,7 +72,7 @@ func TestUserEmailCase(t *testing.T) {
{email: "_______@domain.com "},
} {
newUser := &console.User{
ID: testrand.UUID(),
ID: testrand.UUID2(),
FullName: newName,
ShortName: newLastName,
Email: testCase.email,

View File

@ -7,13 +7,13 @@ import (
"context"
"strconv"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/spacemonkeygo/monkit/v3"
"github.com/zeebo/errs"
"go.uber.org/zap"
"storj.io/common/pb"
"storj.io/common/storj"
"storj.io/common/uuid"
"storj.io/storj/satellite/metainfo"
"storj.io/storj/satellite/overlay"
)

View File

@ -7,11 +7,10 @@ import (
"context"
"strings"
"github.com/skyrings/skyring-common/tools/uuid"
"storj.io/common/pb"
"storj.io/common/rpc/rpcstatus"
"storj.io/common/useragent"
"storj.io/common/uuid"
"storj.io/storj/private/dbutil"
)

View File

@ -6,12 +6,12 @@ package metainfo_test
import (
"testing"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/stretchr/testify/require"
"storj.io/common/pb"
"storj.io/common/testcontext"
"storj.io/common/testrand"
"storj.io/common/uuid"
"storj.io/storj/private/testplanet"
)
@ -32,7 +32,7 @@ func TestResolvePartnerID(t *testing.T) {
_, err = endpoint.ResolvePartnerID(ctx, &pb.RequestHeader{}, []byte{1, 2, 3})
require.Error(t, err)
randomUUID := testrand.UUID()
randomUUID := testrand.UUID2()
// good uuid
result, err := endpoint.ResolvePartnerID(ctx, &pb.RequestHeader{}, randomUUID[:])

View File

@ -6,10 +6,9 @@ package metainfo
import (
"context"
"github.com/skyrings/skyring-common/tools/uuid"
"storj.io/common/macaroon"
"storj.io/common/storj"
"storj.io/common/uuid"
)
// BucketsDB is the interface for the database to interact with buckets

View File

@ -6,13 +6,13 @@ package metainfo_test
import (
"testing"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/stretchr/testify/require"
"storj.io/common/macaroon"
"storj.io/common/storj"
"storj.io/common/testcontext"
"storj.io/common/testrand"
"storj.io/common/uuid"
"storj.io/storj/satellite"
"storj.io/storj/satellite/console"
"storj.io/storj/satellite/satellitedb/satellitedbtest"
@ -20,9 +20,9 @@ import (
func newTestBucket(name string, projectID uuid.UUID) storj.Bucket {
return storj.Bucket{
ID: testrand.UUID(),
ID: storj.DeprecatedUUID(testrand.UUID2()),
Name: name,
ProjectID: projectID,
ProjectID: storj.DeprecatedUUID(projectID),
PathCipher: storj.EncAESGCM,
DefaultSegmentsSize: 65536,
DefaultRedundancyScheme: storj.RedundancyScheme{

View File

@ -8,7 +8,6 @@ import (
"strconv"
"testing"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/stretchr/testify/require"
"storj.io/common/memory"
@ -16,6 +15,7 @@ import (
"storj.io/common/storj"
"storj.io/common/testcontext"
"storj.io/common/testrand"
"storj.io/common/uuid"
"storj.io/storj/private/testplanet"
"storj.io/storj/satellite/metainfo"
"storj.io/storj/storage"

View File

@ -9,13 +9,13 @@ import (
"time"
"github.com/gogo/protobuf/proto"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/spacemonkeygo/monkit/v3"
"github.com/zeebo/errs"
"golang.org/x/time/rate"
"storj.io/common/pb"
"storj.io/common/storj"
"storj.io/common/uuid"
"storj.io/storj/storage"
)

View File

@ -12,7 +12,6 @@ import (
"time"
"github.com/gogo/protobuf/proto"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/spacemonkeygo/monkit/v3"
"github.com/zeebo/errs"
"go.uber.org/zap"
@ -23,6 +22,7 @@ import (
"storj.io/common/rpc/rpcstatus"
"storj.io/common/signing"
"storj.io/common/storj"
"storj.io/common/uuid"
lrucache "storj.io/storj/pkg/cache"
"storj.io/storj/pkg/macaroon"
"storj.io/storj/satellite/accounting"
@ -898,7 +898,7 @@ func (endpoint *Endpoint) setBucketAttribution(ctx context.Context, header *pb.R
}
// update bucket information
bucket.PartnerID = partnerID
bucket.PartnerID = storj.DeprecatedUUID(partnerID)
_, err = endpoint.metainfo.UpdateBucket(ctx, bucket)
if err != nil {
endpoint.log.Error("error while updating bucket", zap.ByteString("bucketName", bucketName), zap.Error(err))
@ -939,10 +939,10 @@ func convertProtoToBucket(req *pb.BucketCreateRequest, projectID uuid.UUID) (buc
}
return storj.Bucket{
ID: *bucketID,
ID: storj.DeprecatedUUID(bucketID),
Name: string(req.GetName()),
ProjectID: projectID,
PartnerID: partnerID,
ProjectID: storj.DeprecatedUUID(projectID),
PartnerID: storj.DeprecatedUUID(partnerID),
PathCipher: storj.CipherSuite(req.GetPathCipher()),
DefaultSegmentsSize: req.GetDefaultSegmentSize(),
DefaultRedundancyScheme: storj.RedundancyScheme{

View File

@ -280,11 +280,11 @@ func TestSetBucketAttribution(t *testing.T) {
require.NoError(t, err)
defer ctx.Check(metainfoClient.Close)
partnerID := testrand.UUID()
partnerID := testrand.UUID2()
{ // bucket with no items
err = metainfoClient.SetBucketAttribution(ctx, metainfo.SetBucketAttributionParams{
Bucket: "alpha",
PartnerID: partnerID,
PartnerID: storj.DeprecatedUUID(partnerID),
})
require.NoError(t, err)
}
@ -292,7 +292,7 @@ func TestSetBucketAttribution(t *testing.T) {
{ // setting attribution on a bucket that doesn't exist should fail
err = metainfoClient.SetBucketAttribution(ctx, metainfo.SetBucketAttributionParams{
Bucket: "beta",
PartnerID: partnerID,
PartnerID: storj.DeprecatedUUID(partnerID),
})
require.Error(t, err)
}
@ -304,7 +304,7 @@ func TestSetBucketAttribution(t *testing.T) {
// trying to set attribution should be ignored
err = metainfoClient.SetBucketAttribution(ctx, metainfo.SetBucketAttributionParams{
Bucket: "alpha",
PartnerID: partnerID,
PartnerID: storj.DeprecatedUUID(partnerID),
})
require.NoError(t, err)
}
@ -316,7 +316,7 @@ func TestSetBucketAttribution(t *testing.T) {
// bucket with items
err = metainfoClient.SetBucketAttribution(ctx, metainfo.SetBucketAttributionParams{
Bucket: "alpha-new",
PartnerID: partnerID,
PartnerID: storj.DeprecatedUUID(partnerID),
})
require.Error(t, err)
}
@ -499,7 +499,7 @@ func TestBeginCommitListSegment(t *testing.T) {
bucket := storj.Bucket{
Name: "initial-bucket",
ProjectID: projectID,
ProjectID: storj.DeprecatedUUID(projectID),
PathCipher: config.GetEncryptionParameters().CipherSuite,
}
_, err = metainfoService.CreateBucket(ctx, bucket)
@ -694,7 +694,7 @@ func TestInlineSegment(t *testing.T) {
bucket := storj.Bucket{
Name: "inline-segments-bucket",
ProjectID: projectID,
ProjectID: storj.DeprecatedUUID(projectID),
PathCipher: config.GetEncryptionParameters().CipherSuite,
}
_, err = metainfoService.CreateBucket(ctx, bucket)

View File

@ -8,13 +8,13 @@ import (
"time"
"github.com/gogo/protobuf/proto"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/zeebo/errs"
"go.uber.org/zap"
"storj.io/common/macaroon"
"storj.io/common/pb"
"storj.io/common/storj"
"storj.io/common/uuid"
"storj.io/storj/storage"
"storj.io/uplink/private/storage/meta"
)

View File

@ -11,7 +11,6 @@ import (
"time"
"github.com/gogo/protobuf/proto"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/zeebo/errs"
"go.uber.org/zap"
"golang.org/x/time/rate"
@ -21,6 +20,7 @@ import (
"storj.io/common/pb"
"storj.io/common/rpc/rpcstatus"
"storj.io/common/storj"
"storj.io/common/uuid"
"storj.io/storj/pkg/auth"
"storj.io/storj/satellite/console"
)

View File

@ -10,7 +10,6 @@ import (
"sort"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
monkit "github.com/spacemonkeygo/monkit/v3"
"github.com/zeebo/errs"
"go.uber.org/zap"
@ -21,6 +20,7 @@ import (
"storj.io/common/rpc/rpcstatus"
"storj.io/common/signing"
"storj.io/common/storj"
"storj.io/common/uuid"
)
// DB implements saving order after receiving from storage node

View File

@ -9,7 +9,6 @@ import (
"testing"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"
@ -19,6 +18,7 @@ import (
"storj.io/common/storj"
"storj.io/common/testcontext"
"storj.io/common/testrand"
"storj.io/common/uuid"
"storj.io/storj/private/testplanet"
"storj.io/storj/satellite"
"storj.io/storj/satellite/accounting/reportedrollup"
@ -396,7 +396,7 @@ func TestLargeOrderLimit(t *testing.T) {
require.NoError(t, chore.RunOnce(ctx, now))
// check only the bandwidth we've used is taken into account
bucketBandwidth, err := ordersDB.GetBucketBandwidth(ctx, *projectID, []byte("b"), beforeRollup, afterRollup)
bucketBandwidth, err := ordersDB.GetBucketBandwidth(ctx, projectID, []byte("b"), beforeRollup, afterRollup)
require.NoError(t, err)
require.Equal(t, int64(100), bucketBandwidth)
@ -422,7 +422,7 @@ func TestProcessOrders(t *testing.T) {
// assertion helpers
checkBucketBandwidth := func(bucket string, amount int64) {
settled, err := ordersDB.GetBucketBandwidth(ctx, *projectID, []byte(bucket), beforeRollup, afterRollup)
settled, err := ordersDB.GetBucketBandwidth(ctx, projectID, []byte(bucket), beforeRollup, afterRollup)
require.NoError(t, err)
require.Equal(t, amount, settled)
}
@ -656,7 +656,7 @@ func TestProcessOrders_DoubleSend(t *testing.T) {
// assertion helpers
checkBucketBandwidth := func(bucket string, amount int64) {
settled, err := ordersDB.GetBucketBandwidth(ctx, *projectID, []byte(bucket), beforeRollup, afterRollup)
settled, err := ordersDB.GetBucketBandwidth(ctx, projectID, []byte(bucket), beforeRollup, afterRollup)
require.NoError(t, err)
require.Equal(t, amount, settled)
}

View File

@ -8,11 +8,11 @@ import (
"sync"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"go.uber.org/zap"
"storj.io/common/pb"
"storj.io/common/sync2"
"storj.io/common/uuid"
)
// CacheData stores the amount of inline and allocated data

View File

@ -9,7 +9,6 @@ import (
"testing"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"
@ -18,6 +17,7 @@ import (
"storj.io/common/pb"
"storj.io/common/testcontext"
"storj.io/common/testrand"
"storj.io/common/uuid"
"storj.io/storj/private/testplanet"
"storj.io/storj/satellite"
"storj.io/storj/satellite/accounting"
@ -42,7 +42,7 @@ func TestRollupsWriteCacheBatchLimitReached(t *testing.T) {
satellitedbtest.Run(t, func(ctx *testcontext.Context, t *testing.T, db satellite.DB) {
useBatchSize := 10
amount := (memory.MB * 500).Int64()
projectID := testrand.UUID()
projectID := testrand.UUID2()
startTime := time.Now()
rwc := orders.NewRollupsWriteCache(zaptest.NewLogger(t), db.Orders(), useBatchSize)
@ -89,7 +89,7 @@ func TestRollupsWriteCacheBatchChore(t *testing.T) {
func(t *testing.T, ctx *testcontext.Context, planet *testplanet.Planet) {
useBatchSize := 10
amount := (memory.MB * 500).Int64()
projectID := testrand.UUID()
projectID := testrand.UUID2()
startTime := time.Now()
planet.Satellites[0].Orders.Chore.Loop.Pause()
@ -145,7 +145,7 @@ func TestUpdateBucketBandwidthAllocation(t *testing.T) {
require.Equal(t, size, 0)
// setup: add one item to the cache
projectID := testrand.UUID()
projectID := testrand.UUID2()
bucketName := []byte("testbucketname")
amount := (memory.MB * 500).Int64()
err := ordersDB.UpdateBucketBandwidthAllocation(ctx, projectID, bucketName, pb.PieceAction_GET, amount, time.Now())
@ -169,7 +169,7 @@ func TestUpdateBucketBandwidthAllocation(t *testing.T) {
require.Equal(t, projectMap, expected)
// setup: add another item to the cache but with a different projectID
projectID2 := testrand.UUID()
projectID2 := testrand.UUID2()
amount2 := (memory.MB * 10).Int64()
err = ordersDB.UpdateBucketBandwidthAllocation(ctx, projectID2, bucketName, pb.PieceAction_GET, amount2, time.Now())
require.NoError(t, err)

View File

@ -11,13 +11,13 @@ import (
"sync"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/zeebo/errs"
"go.uber.org/zap"
"storj.io/common/pb"
"storj.io/common/signing"
"storj.io/common/storj"
"storj.io/common/uuid"
"storj.io/storj/satellite/overlay"
"storj.io/uplink/private/eestream"
)
@ -82,7 +82,7 @@ func (service *Service) createSerial(ctx context.Context) (_ storj.SerialNumber,
if err != nil {
return storj.SerialNumber{}, Error.Wrap(err)
}
return storj.SerialNumber(*id), nil
return storj.SerialNumber(id), nil
}
func (service *Service) saveSerial(ctx context.Context, serialNumber storj.SerialNumber, bucketID []byte, expiresAt time.Time) (err error) {

View File

@ -7,8 +7,9 @@ import (
"context"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/zeebo/errs"
"storj.io/common/uuid"
)
// ErrAccountNotSetup is an error type which indicates that payment account is not created.

View File

@ -7,9 +7,8 @@ import (
"context"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"storj.io/common/memory"
"storj.io/common/uuid"
)
// Coupons exposes all needed functionality to manage coupons.

View File

@ -6,7 +6,7 @@ package payments
import (
"context"
"github.com/skyrings/skyring-common/tools/uuid"
"storj.io/common/uuid"
)
// CreditCards exposes all needed functionality to manage account credit cards.

View File

@ -7,8 +7,7 @@ import (
"context"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"storj.io/common/uuid"
"storj.io/storj/satellite/payments/coinpayments"
)

View File

@ -7,7 +7,7 @@ import (
"context"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"storj.io/common/uuid"
)
// Invoices exposes all needed functionality to manage account invoices.

View File

@ -7,11 +7,11 @@ import (
"context"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/spacemonkeygo/monkit/v3"
"github.com/zeebo/errs"
"storj.io/common/memory"
"storj.io/common/uuid"
"storj.io/storj/satellite/payments"
)

View File

@ -4,8 +4,7 @@
package payments
import (
"github.com/skyrings/skyring-common/tools/uuid"
"storj.io/common/uuid"
"storj.io/storj/satellite/accounting"
)

View File

@ -7,9 +7,9 @@ import (
"context"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/stripe/stripe-go"
"storj.io/common/uuid"
"storj.io/storj/satellite/payments"
)

View File

@ -7,10 +7,10 @@ import (
"context"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/stripe/stripe-go"
"storj.io/common/memory"
"storj.io/common/uuid"
"storj.io/storj/satellite/payments"
)

View File

@ -7,12 +7,12 @@ import (
"testing"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/stretchr/testify/require"
"storj.io/common/memory"
"storj.io/common/testcontext"
"storj.io/common/testrand"
"storj.io/common/uuid"
"storj.io/storj/satellite"
"storj.io/storj/satellite/console"
"storj.io/storj/satellite/payments"
@ -28,8 +28,8 @@ func TestCouponRepository(t *testing.T) {
Amount: 10,
Status: payments.CouponActive,
Description: "description",
ProjectID: testrand.UUID(),
UserID: testrand.UUID(),
ProjectID: testrand.UUID2(),
UserID: testrand.UUID2(),
}
now := time.Now().UTC()
@ -112,7 +112,7 @@ func TestPopulatePromotionalCoupons(t *testing.T) {
// activated user with 2 project. New coupon should be added to the first project.
user1, err := usersRepo.Insert(ctx, &console.User{
ID: testrand.UUID(),
ID: testrand.UUID2(),
FullName: "user1",
ShortName: "",
Email: "test1@example.com",
@ -127,7 +127,7 @@ func TestPopulatePromotionalCoupons(t *testing.T) {
// activated user with proj. New coupon should be added.
user2, err := usersRepo.Insert(ctx, &console.User{
ID: testrand.UUID(),
ID: testrand.UUID2(),
FullName: "user2",
ShortName: "",
Email: "test2@example.com",
@ -142,7 +142,7 @@ func TestPopulatePromotionalCoupons(t *testing.T) {
// activated user without proj. New coupon should not be added.
user3, err := usersRepo.Insert(ctx, &console.User{
ID: testrand.UUID(),
ID: testrand.UUID2(),
FullName: "user3",
ShortName: "",
Email: "test3@example.com",
@ -157,7 +157,7 @@ func TestPopulatePromotionalCoupons(t *testing.T) {
// inactive user. New coupon should not be added.
user4, err := usersRepo.Insert(ctx, &console.User{
ID: testrand.UUID(),
ID: testrand.UUID2(),
FullName: "user4",
ShortName: "",
Email: "test4@example.com",
@ -167,7 +167,7 @@ func TestPopulatePromotionalCoupons(t *testing.T) {
// activated user with proj and coupon. New coupon should not be added.
user5, err := usersRepo.Insert(ctx, &console.User{
ID: testrand.UUID(),
ID: testrand.UUID2(),
FullName: "user5",
ShortName: "",
Email: "test5@example.com",
@ -182,7 +182,7 @@ func TestPopulatePromotionalCoupons(t *testing.T) {
// creating projects for users above.
proj1, err := projectsRepo.Insert(ctx, &console.Project{
ID: testrand.UUID(),
ID: testrand.UUID2(),
Name: "proj 1 of user 1",
Description: "descr 1",
OwnerID: user1.ID,
@ -191,7 +191,7 @@ func TestPopulatePromotionalCoupons(t *testing.T) {
// should not be processed as we takes only first project of the user.
proj2, err := projectsRepo.Insert(ctx, &console.Project{
ID: testrand.UUID(),
ID: testrand.UUID2(),
Name: "proj 2 of user 1",
Description: "descr 2",
OwnerID: user1.ID,
@ -199,7 +199,7 @@ func TestPopulatePromotionalCoupons(t *testing.T) {
require.NoError(t, err)
proj3, err := projectsRepo.Insert(ctx, &console.Project{
ID: testrand.UUID(),
ID: testrand.UUID2(),
Name: "proj 1 of user 2",
Description: "descr 3",
OwnerID: user2.ID,
@ -207,14 +207,14 @@ func TestPopulatePromotionalCoupons(t *testing.T) {
require.NoError(t, err)
proj4, err := projectsRepo.Insert(ctx, &console.Project{
ID: testrand.UUID(),
ID: testrand.UUID2(),
Name: "proj 1 of user 5",
Description: "descr 4",
OwnerID: user5.ID,
})
require.NoError(t, err)
couponID := testrand.UUID()
couponID := testrand.UUID2()
err = couponsRepo.Insert(ctx, payments.Coupon{
ID: couponID,
UserID: user5.ID,
@ -229,7 +229,7 @@ func TestPopulatePromotionalCoupons(t *testing.T) {
// creating new users and projects to test that multiple execution of populate method wont generate extra coupons.
user6, err := usersRepo.Insert(ctx, &console.User{
ID: testrand.UUID(),
ID: testrand.UUID2(),
FullName: "user6",
ShortName: "",
Email: "test6@example.com",
@ -243,7 +243,7 @@ func TestPopulatePromotionalCoupons(t *testing.T) {
require.NoError(t, err)
proj5, err := projectsRepo.Insert(ctx, &console.Project{
ID: testrand.UUID(),
ID: testrand.UUID2(),
Name: "proj 1 of user 6",
Description: "descr 6",
OwnerID: user6.ID,

View File

@ -6,10 +6,10 @@ package stripecoinpayments
import (
"context"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/stripe/stripe-go"
"github.com/zeebo/errs"
"storj.io/common/uuid"
"storj.io/storj/satellite/payments"
)

View File

@ -7,8 +7,7 @@ import (
"context"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"storj.io/common/uuid"
"storj.io/storj/satellite/payments"
"storj.io/storj/satellite/payments/coinpayments"
)

View File

@ -8,12 +8,12 @@ import (
"testing"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"storj.io/common/testcontext"
"storj.io/common/testrand"
"storj.io/common/uuid"
"storj.io/storj/satellite"
"storj.io/storj/satellite/payments"
"storj.io/storj/satellite/payments/coinpayments"
@ -24,7 +24,7 @@ import (
func TestCreditsRepository(t *testing.T) {
satellitedbtest.Run(t, func(ctx *testcontext.Context, t *testing.T, db satellite.DB) {
creditsRepo := db.StripeCoinPayments().Credits()
userID := testrand.UUID()
userID := testrand.UUID2()
credit := payments.Credit{
UserID: userID,
Amount: 10,
@ -32,7 +32,7 @@ func TestCreditsRepository(t *testing.T) {
}
spending := stripecoinpayments.CreditsSpending{
ProjectID: testrand.UUID(),
ProjectID: testrand.UUID2(),
UserID: userID,
Amount: 5,
Status: stripecoinpayments.CreditsSpendingStatusUnapplied,
@ -95,9 +95,9 @@ func TestCreditsRepositoryList(t *testing.T) {
require.NoError(t, err)
spending := stripecoinpayments.CreditsSpending{
ID: *spendingID,
ProjectID: *projectID,
UserID: *userID,
ID: spendingID,
ProjectID: projectID,
UserID: userID,
Amount: int64(5 + i),
Status: 0,
}
@ -136,7 +136,7 @@ func TestCreditsRepositoryList(t *testing.T) {
transactionID := "transID" + strconv.Itoa(i)
credit := payments.Credit{
UserID: *user2ID,
UserID: user2ID,
Amount: 5,
TransactionID: coinpayments.TransactionID(transactionID),
}
@ -145,21 +145,21 @@ func TestCreditsRepositoryList(t *testing.T) {
require.NoError(t, err)
}
page2, err := creditsDB.ListCreditsPaged(ctx, 0, spendLen, time.Now(), *user2ID)
page2, err := creditsDB.ListCreditsPaged(ctx, 0, spendLen, time.Now(), user2ID)
require.NoError(t, err)
require.Equal(t, spendLen, len(page2.Credits))
assert.True(t, page2.Next)
assert.Equal(t, int64(5), page2.NextOffset)
page2, err = creditsDB.ListCreditsPaged(ctx, page2.NextOffset, spendLen, time.Now(), *user2ID)
page2, err = creditsDB.ListCreditsPaged(ctx, page2.NextOffset, spendLen, time.Now(), user2ID)
require.NoError(t, err)
require.Equal(t, spendLen, len(page2.Credits))
assert.True(t, page2.Next)
assert.Equal(t, int64(10), page2.NextOffset)
page2, err = creditsDB.ListCreditsPaged(ctx, page2.NextOffset, spendLen, time.Now(), *user2ID)
page2, err = creditsDB.ListCreditsPaged(ctx, page2.NextOffset, spendLen, time.Now(), user2ID)
require.NoError(t, err)
require.Equal(t, 3, len(page2.Credits))

View File

@ -7,7 +7,7 @@ import (
"context"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"storj.io/common/uuid"
)
// ErrNoCustomer is error class defining that there is no customer for user.

View File

@ -8,11 +8,11 @@ import (
"testing"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"storj.io/common/testcontext"
"storj.io/common/uuid"
"storj.io/storj/satellite"
"storj.io/storj/satellite/payments/stripecoinpayments"
"storj.io/storj/satellite/satellitedb/satellitedbtest"
@ -27,17 +27,17 @@ func TestCustomersRepository(t *testing.T) {
require.NoError(t, err)
t.Run("Insert", func(t *testing.T) {
err = customers.Insert(ctx, *userID, customerID)
err = customers.Insert(ctx, userID, customerID)
assert.NoError(t, err)
})
t.Run("Can not insert duplicate customerID", func(t *testing.T) {
err = customers.Insert(ctx, *userID, customerID)
err = customers.Insert(ctx, userID, customerID)
assert.Error(t, err)
})
t.Run("GetCustomerID", func(t *testing.T) {
id, err := customers.GetCustomerID(ctx, *userID)
id, err := customers.GetCustomerID(ctx, userID)
assert.NoError(t, err)
assert.Equal(t, id, customerID)
})
@ -56,7 +56,7 @@ func TestCustomersRepositoryList(t *testing.T) {
cus := stripecoinpayments.Customer{
ID: "customerID" + strconv.Itoa(i),
UserID: *userID,
UserID: userID,
}
err = customersDB.Insert(ctx, cus.UserID, cus.ID)

View File

@ -7,9 +7,9 @@ import (
"context"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/stripe/stripe-go"
"storj.io/common/uuid"
"storj.io/storj/satellite/payments"
)

View File

@ -7,7 +7,7 @@ import (
"context"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"storj.io/common/uuid"
)
// ErrProjectRecordExists is error class defining that such project record already exists.

View File

@ -7,11 +7,11 @@ import (
"testing"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"storj.io/common/testcontext"
"storj.io/common/uuid"
"storj.io/storj/satellite"
"storj.io/storj/satellite/payments/stripecoinpayments"
"storj.io/storj/satellite/satellitedb/satellitedbtest"
@ -33,7 +33,7 @@ func TestProjectRecords(t *testing.T) {
err = projectRecordsDB.Create(ctx,
[]stripecoinpayments.CreateProjectRecord{
{
ProjectID: *prjID,
ProjectID: prjID,
Storage: 1,
Egress: 2,
Objects: 3,
@ -47,7 +47,7 @@ func TestProjectRecords(t *testing.T) {
})
t.Run("check", func(t *testing.T) {
err = projectRecordsDB.Check(ctx, *prjID, start, end)
err = projectRecordsDB.Check(ctx, prjID, start, end)
require.Error(t, err)
assert.Equal(t, stripecoinpayments.ErrProjectRecordExists, err)
})
@ -86,7 +86,7 @@ func TestProjectRecordsList(t *testing.T) {
createProjectRecords = append(createProjectRecords,
stripecoinpayments.CreateProjectRecord{
ProjectID: *projID,
ProjectID: projID,
Storage: float64(i) + 1,
Egress: int64(i) + 2,
Objects: float64(i) + 3,

View File

@ -11,7 +11,6 @@ import (
"time"
"github.com/shopspring/decimal"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/spacemonkeygo/monkit/v3"
"github.com/stripe/stripe-go"
"github.com/stripe/stripe-go/client"
@ -19,6 +18,7 @@ import (
"go.uber.org/zap"
"storj.io/common/memory"
"storj.io/common/uuid"
"storj.io/storj/satellite/accounting"
"storj.io/storj/satellite/console"
"storj.io/storj/satellite/payments"
@ -509,7 +509,7 @@ func (service *Service) createProjectRecords(ctx context.Context, projects []con
}
creditsSpendings = append(creditsSpendings, CreditsSpending{
ID: *creditSpendingID,
ID: creditSpendingID,
Amount: amountChargedFromBonuses,
UserID: project.OwnerID,
ProjectID: project.ID,

View File

@ -6,8 +6,7 @@ package stripecoinpayments
import (
"context"
"github.com/skyrings/skyring-common/tools/uuid"
"storj.io/common/uuid"
"storj.io/storj/satellite/payments"
"storj.io/storj/satellite/payments/coinpayments"
)

View File

@ -8,9 +8,9 @@ import (
"math/big"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/zeebo/errs"
"storj.io/common/uuid"
"storj.io/storj/satellite/payments/coinpayments"
)

View File

@ -10,7 +10,6 @@ import (
"testing"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/zeebo/errs"
@ -19,6 +18,7 @@ import (
"storj.io/common/memory"
"storj.io/common/testcontext"
"storj.io/common/testrand"
"storj.io/common/uuid"
"storj.io/storj/satellite"
"storj.io/storj/satellite/payments/coinpayments"
"storj.io/storj/satellite/payments/stripecoinpayments"

View File

@ -8,7 +8,7 @@ import (
"math/big"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"storj.io/common/uuid"
)
// StorjTokens defines all payments STORJ token related functionality.

View File

@ -6,7 +6,6 @@ package referrals
import (
"context"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/spacemonkeygo/monkit/v3"
"github.com/zeebo/errs"
"go.uber.org/zap"
@ -16,6 +15,7 @@ import (
"storj.io/common/rpc"
"storj.io/common/signing"
"storj.io/common/storj"
"storj.io/common/uuid"
"storj.io/storj/private/dbutil"
"storj.io/storj/satellite/console"
)
@ -120,7 +120,7 @@ func (service *Service) CreateUser(ctx context.Context, user CreateUser) (_ *con
return nil, errs.Wrap(err)
}
err = service.redeemToken(ctx, userID, user.ReferralToken)
err = service.redeemToken(ctx, &userID, user.ReferralToken)
if err != nil {
return nil, errs.Wrap(err)
}
@ -131,7 +131,7 @@ func (service *Service) CreateUser(ctx context.Context, user CreateUser) (_ *con
}
newUser := &console.User{
ID: *userID,
ID: userID,
Email: user.Email,
FullName: user.FullName,
ShortName: user.ShortName,

View File

@ -34,7 +34,7 @@ func TestServiceSuccess(t *testing.T) {
satellite := planet.Satellites[0]
userID := testrand.UUID()
userID := testrand.UUID2()
tokens, err := satellite.API.Referrals.Service.GetTokens(ctx, &userID)
require.NoError(t, err)
require.Len(t, tokens, tokenCount)
@ -44,7 +44,7 @@ func TestServiceSuccess(t *testing.T) {
ShortName: "test",
Email: "test@mail.test",
Password: "123a123",
ReferralToken: testrand.UUID().String(),
ReferralToken: testrand.UUID2().String(),
}
createdUser, err := satellite.API.Referrals.Service.CreateUser(ctx, user)
@ -74,7 +74,7 @@ func TestServiceRedeemFailure(t *testing.T) {
ShortName: "test",
Email: "test@mail.test",
Password: "123a123",
ReferralToken: testrand.UUID().String(),
ReferralToken: testrand.UUID2().String(),
}
_, err := satellite.API.Referrals.Service.CreateUser(ctx, user)
require.Error(t, err)

View File

@ -6,9 +6,9 @@ package referrals
import (
"net/mail"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/zeebo/errs"
"storj.io/common/uuid"
"storj.io/storj/satellite/console"
)

View File

@ -37,7 +37,7 @@ func TestIdentifyInjuredSegments(t *testing.T) {
ErasureShareSize: int32(256),
}
projectID := testrand.UUID()
projectID := testrand.UUID2()
pointerPathPrefix := storj.JoinPaths(projectID.String(), "l", "bucket") + "/"
// add some valid pointers
@ -100,7 +100,7 @@ func TestIdentifyIrreparableSegments(t *testing.T) {
expectedLostPieces[int32(i)] = true
}
projectID := testrand.UUID()
projectID := testrand.UUID2()
pointerPath := storj.JoinPaths(projectID.String(), "l", "bucket", "piece")
pieceID := testrand.PieceID()

View File

@ -8,8 +8,9 @@ import (
"os"
"strings"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/zeebo/errs"
"storj.io/common/uuid"
)
// PartnerList defines a json struct for defining partners.

View File

@ -3,7 +3,7 @@
package rewards
import "github.com/skyrings/skyring-common/tools/uuid"
import "storj.io/common/uuid"
// DefaultPartnersDB is current default settings.
var DefaultPartnersDB = func() PartnersDB {

View File

@ -7,9 +7,9 @@ import (
"context"
"strings"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/zeebo/errs"
"storj.io/common/uuid"
"storj.io/storj/pkg/cache"
"storj.io/storj/private/dbutil"
"storj.io/storj/satellite/console"

View File

@ -8,9 +8,9 @@ import (
"database/sql"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/zeebo/errs"
"storj.io/common/uuid"
"storj.io/storj/private/dbutil"
"storj.io/storj/satellite/attribution"
"storj.io/storj/satellite/satellitedb/dbx"

View File

@ -7,12 +7,12 @@ import (
"testing"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/stretchr/testify/require"
"storj.io/common/storj"
"storj.io/common/testcontext"
"storj.io/common/testrand"
"storj.io/common/uuid"
"storj.io/storj/satellite"
"storj.io/storj/satellite/console"
"storj.io/storj/satellite/satellitedb/satellitedbtest"
@ -27,18 +27,18 @@ func TestUsers(t *testing.T) {
// create an user with partnerID
_, err := consoleDB.Users().Insert(ctx, &console.User{
ID: testrand.UUID(),
ID: testrand.UUID2(),
FullName: "John Doe",
Email: "john@mail.test",
PasswordHash: userPassHash,
Status: console.Active,
PartnerID: testrand.UUID(),
PartnerID: testrand.UUID2(),
})
require.NoError(t, err)
// create an user with no partnerID
_, err = consoleDB.Users().Insert(ctx, &console.User{
ID: testrand.UUID(),
ID: testrand.UUID2(),
FullName: "John Doe",
Email: "john@mail.test",
PasswordHash: userPassHash,
@ -48,17 +48,17 @@ func TestUsers(t *testing.T) {
// create a project with partnerID
_, err = consoleDB.Projects().Insert(ctx, &console.Project{
ID: testrand.UUID(),
ID: testrand.UUID2(),
Name: "John Doe",
Description: "some description",
PartnerID: testrand.UUID(),
PartnerID: testrand.UUID2(),
CreatedAt: time.Now(),
})
require.NoError(t, err)
// create a project with no partnerID
proj, err := consoleDB.Projects().Insert(ctx, &console.Project{
ID: testrand.UUID(),
ID: testrand.UUID2(),
Name: "John Doe",
Description: "some description",
CreatedAt: time.Now(),
@ -67,7 +67,7 @@ func TestUsers(t *testing.T) {
// create a APIKey with no partnerID
_, err = consoleDB.APIKeys().Create(ctx, testrand.Bytes(8), console.APIKeyInfo{
ID: testrand.UUID(),
ID: testrand.UUID2(),
ProjectID: proj.ID,
Name: "John Doe",
Secret: []byte("xyz"),
@ -77,9 +77,9 @@ func TestUsers(t *testing.T) {
// create a bucket with no partnerID
_, err = db.Buckets().CreateBucket(ctx, storj.Bucket{
ID: testrand.UUID(),
ID: storj.DeprecatedUUID(testrand.UUID2()),
Name: "testbucket",
ProjectID: proj.ID,
ProjectID: storj.DeprecatedUUID(proj.ID),
Created: time.Now(),
PathCipher: storj.EncAESGCM,
DefaultSegmentsSize: int64(100),
@ -88,10 +88,10 @@ func TestUsers(t *testing.T) {
// update a bucket with partnerID
bucket, err := db.Buckets().UpdateBucket(ctx, storj.Bucket{
ID: testrand.UUID(),
ID: storj.DeprecatedUUID(testrand.UUID2()),
Name: "testbucket",
ProjectID: proj.ID,
PartnerID: proj.ID,
ProjectID: storj.DeprecatedUUID(proj.ID),
PartnerID: storj.DeprecatedUUID(proj.ID),
Created: time.Now(),
PathCipher: storj.EncAESGCM,
DefaultSegmentsSize: int64(100),
@ -99,7 +99,7 @@ func TestUsers(t *testing.T) {
require.NoError(t, err)
bucket, err = db.Buckets().GetBucket(ctx, []byte("testbucket"), proj.ID)
require.NoError(t, err)
flag := uuid.Equal(bucket.PartnerID, proj.ID)
flag := uuid.UUID(bucket.PartnerID) == proj.ID
require.True(t, flag)
})
}

View File

@ -8,10 +8,9 @@ import (
"database/sql"
"errors"
"github.com/skyrings/skyring-common/tools/uuid"
"storj.io/common/macaroon"
"storj.io/common/storj"
"storj.io/common/uuid"
"storj.io/storj/private/dbutil"
"storj.io/storj/satellite/metainfo"
"storj.io/storj/satellite/satellitedb/dbx"
@ -202,9 +201,9 @@ func convertDBXtoBucket(dbxBucket *dbx.BucketMetainfo) (bucket storj.Bucket, err
}
bucket = storj.Bucket{
ID: id,
ID: storj.DeprecatedUUID(id),
Name: string(dbxBucket.Name),
ProjectID: project,
ProjectID: storj.DeprecatedUUID(project),
Created: dbxBucket.CreatedAt,
PathCipher: storj.CipherSuite(dbxBucket.PathCipher),
DefaultSegmentsSize: int64(dbxBucket.DefaultSegmentSize),
@ -227,7 +226,7 @@ func convertDBXtoBucket(dbxBucket *dbx.BucketMetainfo) (bucket storj.Bucket, err
if err != nil {
return bucket, storj.ErrBucket.Wrap(err)
}
bucket.PartnerID = partnerID
bucket.PartnerID = storj.DeprecatedUUID(partnerID)
}
return bucket, nil

View File

@ -8,9 +8,9 @@ import (
"math/big"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/zeebo/errs"
"storj.io/common/uuid"
"storj.io/storj/private/dbutil"
"storj.io/storj/satellite/payments/coinpayments"
"storj.io/storj/satellite/payments/stripecoinpayments"

View File

@ -10,10 +10,10 @@ import (
"time"
"github.com/lib/pq"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/zeebo/errs"
"storj.io/common/memory"
"storj.io/common/uuid"
"storj.io/storj/private/dbutil"
"storj.io/storj/satellite/console"
"storj.io/storj/satellite/payments"

View File

@ -7,9 +7,9 @@ import (
"context"
"time"
"github.com/skyrings/skyring-common/tools/uuid"
"github.com/zeebo/errs"
"storj.io/common/uuid"
"storj.io/storj/private/dbutil"
"storj.io/storj/satellite/payments"
"storj.io/storj/satellite/payments/coinpayments"

Some files were not shown because too many files have changed in this diff Show More