bump storj.io/common to latest

Change-Id: I16e337660ce8e1ef332cc842dbf4cfa067b9b98b
This commit is contained in:
Yingrong Zhao 2020-03-25 08:15:27 -04:00
parent 0a50d6bdce
commit b7b19289d1
19 changed files with 34 additions and 32 deletions

View File

@ -231,7 +231,7 @@ func TestNewClient(t *testing.T) {
defer ctx.Check(conn.Close) defer ctx.Check(conn.Close)
client := certificateclient.NewClientFrom(pb.NewDRPCCertificatesClient(conn.Raw())) client := certificateclient.NewClientFrom(pb.NewDRPCCertificatesClient(conn))
assert.NoError(t, err) assert.NoError(t, err)
assert.NotNil(t, client) assert.NotNil(t, client)

View File

@ -41,7 +41,7 @@ func New(ctx context.Context, dialer rpc.Dialer, address string) (_ *Client, err
return &Client{ return &Client{
conn: conn, conn: conn,
client: pb.NewDRPCCertificatesClient(conn.Raw()), client: pb.NewDRPCCertificatesClient(conn),
}, nil }, nil
} }

View File

@ -142,10 +142,10 @@ func NewInspector(address, path string) (*Inspector, error) {
return &Inspector{ return &Inspector{
conn: conn, conn: conn,
identity: id, identity: id,
overlayclient: pb.NewDRPCOverlayInspectorClient(conn.Raw()), overlayclient: pb.NewDRPCOverlayInspectorClient(conn),
irrdbclient: pb.NewDRPCIrreparableInspectorClient(conn.Raw()), irrdbclient: pb.NewDRPCIrreparableInspectorClient(conn),
healthclient: pb.NewDRPCHealthInspectorClient(conn.Raw()), healthclient: pb.NewDRPCHealthInspectorClient(conn),
paymentsClient: pb.NewDRPCPaymentsClient(conn.Raw()), paymentsClient: pb.NewDRPCPaymentsClient(conn),
}, nil }, nil
} }

View File

@ -40,7 +40,7 @@ func dialDashboardClient(ctx context.Context, address string) (*dashboardClient,
} }
func (dash *dashboardClient) dashboard(ctx context.Context) (*pb.DashboardResponse, error) { func (dash *dashboardClient) dashboard(ctx context.Context) (*pb.DashboardResponse, error) {
return pb.NewDRPCPieceStoreInspectorClient(dash.conn.Raw()).Dashboard(ctx, &pb.DashboardRequest{}) return pb.NewDRPCPieceStoreInspectorClient(dash.conn).Dashboard(ctx, &pb.DashboardRequest{})
} }
func (dash *dashboardClient) close() error { func (dash *dashboardClient) close() error {

View File

@ -37,15 +37,15 @@ func dialGracefulExitClient(ctx context.Context, address string) (*gracefulExitC
} }
func (client *gracefulExitClient) getNonExitingSatellites(ctx context.Context) (*pb.GetNonExitingSatellitesResponse, error) { func (client *gracefulExitClient) getNonExitingSatellites(ctx context.Context) (*pb.GetNonExitingSatellitesResponse, error) {
return pb.NewDRPCNodeGracefulExitClient(client.conn.Raw()).GetNonExitingSatellites(ctx, &pb.GetNonExitingSatellitesRequest{}) return pb.NewDRPCNodeGracefulExitClient(client.conn).GetNonExitingSatellites(ctx, &pb.GetNonExitingSatellitesRequest{})
} }
func (client *gracefulExitClient) initGracefulExit(ctx context.Context, req *pb.InitiateGracefulExitRequest) (*pb.ExitProgress, error) { func (client *gracefulExitClient) initGracefulExit(ctx context.Context, req *pb.InitiateGracefulExitRequest) (*pb.ExitProgress, error) {
return pb.NewDRPCNodeGracefulExitClient(client.conn.Raw()).InitiateGracefulExit(ctx, req) return pb.NewDRPCNodeGracefulExitClient(client.conn).InitiateGracefulExit(ctx, req)
} }
func (client *gracefulExitClient) getExitProgress(ctx context.Context) (*pb.GetExitProgressResponse, error) { func (client *gracefulExitClient) getExitProgress(ctx context.Context) (*pb.GetExitProgressResponse, error) {
return pb.NewDRPCNodeGracefulExitClient(client.conn.Raw()).GetExitProgress(ctx, &pb.GetExitProgressRequest{}) return pb.NewDRPCNodeGracefulExitClient(client.conn).GetExitProgress(ctx, &pb.GetExitProgressRequest{})
} }
func (client *gracefulExitClient) close() error { func (client *gracefulExitClient) close() error {

2
go.mod
View File

@ -41,7 +41,7 @@ require (
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 golang.org/x/time v0.0.0-20191024005414-555d28b269f0
google.golang.org/grpc v1.27.1 google.golang.org/grpc v1.27.1
storj.io/common v0.0.0-20200324171116-bad40c947e25 storj.io/common v0.0.0-20200325130515-1ce63718a5c6
storj.io/drpc v0.0.11 storj.io/drpc v0.0.11
storj.io/private v0.0.0-20200323175212-c3ef21e873a9 storj.io/private v0.0.0-20200323175212-c3ef21e873a9
storj.io/uplink v1.0.1 storj.io/uplink v1.0.1

2
go.sum
View File

@ -598,6 +598,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-20200323134045-2bd4d6e2dd7d/go.mod h1:I0QTs7z1rI+ZEN95GGY2LKMzP5OZqu0Udga3WhyQfO0=
storj.io/common v0.0.0-20200324171116-bad40c947e25 h1:AU4vRaFLkATRaCN6cZY0MiyNdl1n3aRkkEn/1mEo3Sc= storj.io/common v0.0.0-20200324171116-bad40c947e25 h1:AU4vRaFLkATRaCN6cZY0MiyNdl1n3aRkkEn/1mEo3Sc=
storj.io/common v0.0.0-20200324171116-bad40c947e25/go.mod h1:RBaNRmk/lqyZ7h1MAH4N9zld0z+tO4M9sLOFT30K+cE= storj.io/common v0.0.0-20200324171116-bad40c947e25/go.mod h1:RBaNRmk/lqyZ7h1MAH4N9zld0z+tO4M9sLOFT30K+cE=
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/drpc v0.0.7-0.20191115031725-2171c57838d2/go.mod h1:/ascUDbzNAv0A3Jj7wUIKFBH2JdJ2uJIBO/b9+2yHgQ= 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 h1:6vLxfpSbwCLtqzAoXzXx/SxBqBtbzbmquXPqfcWKqfw=
storj.io/drpc v0.0.11/go.mod h1:TiFc2obNjL9/3isMW1Rpxjy8V9uE0B2HMeMFGiiI7Iw= storj.io/drpc v0.0.11/go.mod h1:TiFc2obNjL9/3isMW1Rpxjy8V9uE0B2HMeMFGiiI7Iw=

View File

@ -39,7 +39,7 @@ func TestBasic(t *testing.T) {
conn, err := sn.Dialer.DialNode(ctx, &satellite) conn, err := sn.Dialer.DialNode(ctx, &satellite)
require.NoError(t, err) require.NoError(t, err)
defer ctx.Check(conn.Close) defer ctx.Check(conn.Close)
_, err = pb.NewDRPCNodeClient(conn.Raw()).CheckIn(ctx, &pb.CheckInRequest{ _, err = pb.NewDRPCNodeClient(conn).CheckIn(ctx, &pb.CheckInRequest{
Address: node.GetAddress().GetAddress(), Address: node.GetAddress().GetAddress(),
Version: &node.Version, Version: &node.Version,
Capacity: &node.Capacity, Capacity: &node.Capacity,

View File

@ -25,7 +25,7 @@ func dialNode(ctx context.Context, dialer rpc.Dialer, address string, id storj.N
return &client{ return &client{
conn: conn, conn: conn,
client: pb.NewDRPCContactClient(conn.Raw()), client: pb.NewDRPCContactClient(conn),
}, nil }, nil
} }

View File

@ -184,7 +184,7 @@ func TestConcurrentConnections(t *testing.T) {
err = errs.Combine(err, conn.Close()) err = errs.Combine(err, conn.Close())
}() }()
client := pb.NewDRPCSatelliteGracefulExitClient(conn.Raw()) client := pb.NewDRPCSatelliteGracefulExitClient(conn)
// wait for "main" call to begin // wait for "main" call to begin
wg.Wait() wg.Wait()
@ -204,7 +204,7 @@ func TestConcurrentConnections(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
defer ctx.Check(conn.Close) defer ctx.Check(conn.Close)
client := pb.NewDRPCSatelliteGracefulExitClient(conn.Raw()) client := pb.NewDRPCSatelliteGracefulExitClient(conn)
// this connection will immediately return since graceful exit has not been initiated yet // this connection will immediately return since graceful exit has not been initiated yet
c, err := client.Process(ctx) c, err := client.Process(ctx)
require.NoError(t, err) require.NoError(t, err)
@ -405,7 +405,7 @@ func TestExitDisqualifiedNodeFailOnStart(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
defer ctx.Check(conn.Close) defer ctx.Check(conn.Close)
client := pb.NewDRPCSatelliteGracefulExitClient(conn.Raw()) client := pb.NewDRPCSatelliteGracefulExitClient(conn)
processClient, err := client.Process(ctx) processClient, err := client.Process(ctx)
require.NoError(t, err) require.NoError(t, err)
@ -952,7 +952,7 @@ func TestExitDisabled(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
defer ctx.Check(conn.Close) defer ctx.Check(conn.Close)
client := pb.NewDRPCSatelliteGracefulExitClient(conn.Raw()) client := pb.NewDRPCSatelliteGracefulExitClient(conn)
processClient, err := client.Process(ctx) processClient, err := client.Process(ctx)
require.NoError(t, err) require.NoError(t, err)
@ -1029,7 +1029,7 @@ func TestPointerChangedOrDeleted(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
defer ctx.Check(conn.Close) defer ctx.Check(conn.Close)
client := pb.NewDRPCSatelliteGracefulExitClient(conn.Raw()) client := pb.NewDRPCSatelliteGracefulExitClient(conn)
c, err := client.Process(ctx) c, err := client.Process(ctx)
require.NoError(t, err) require.NoError(t, err)
@ -1266,7 +1266,7 @@ func TestFailureStorageNodeIgnoresTransferMessages(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
defer ctx.Check(conn.Close) defer ctx.Check(conn.Close)
client := pb.NewDRPCSatelliteGracefulExitClient(conn.Raw()) client := pb.NewDRPCSatelliteGracefulExitClient(conn)
c, err := client.Process(ctx) c, err := client.Process(ctx)
require.NoError(t, err) require.NoError(t, err)
@ -1394,7 +1394,7 @@ func TestIneligibleNodeAge(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
defer ctx.Check(conn.Close) defer ctx.Check(conn.Close)
client := pb.NewDRPCSatelliteGracefulExitClient(conn.Raw()) client := pb.NewDRPCSatelliteGracefulExitClient(conn)
c, err := client.Process(ctx) c, err := client.Process(ctx)
require.NoError(t, err) require.NoError(t, err)
@ -1452,7 +1452,7 @@ func testTransfers(t *testing.T, objects int, verifier func(t *testing.T, ctx *t
require.NoError(t, err) require.NoError(t, err)
defer ctx.Check(conn.Close) defer ctx.Check(conn.Close)
client := pb.NewDRPCSatelliteGracefulExitClient(conn.Raw()) client := pb.NewDRPCSatelliteGracefulExitClient(conn)
c, err := client.Process(ctx) c, err := client.Process(ctx)
require.NoError(t, err) require.NoError(t, err)

View File

@ -72,7 +72,7 @@ func (service *Service) GetTokens(ctx context.Context, userID *uuid.UUID) (token
err = conn.Close() err = conn.Close()
}() }()
client := pb.NewDRPCReferralManagerClient(conn.Raw()) client := pb.NewDRPCReferralManagerClient(conn)
response, err := client.GetTokens(ctx, &pb.GetTokensRequest{ response, err := client.GetTokens(ctx, &pb.GetTokensRequest{
OwnerUserId: userID[:], OwnerUserId: userID[:],
OwnerSatelliteId: service.signer.ID(), OwnerSatelliteId: service.signer.ID(),
@ -166,7 +166,7 @@ func (service *Service) redeemToken(ctx context.Context, userID *uuid.UUID, toke
return errs.Wrap(err) return errs.Wrap(err)
} }
client := pb.NewDRPCReferralManagerClient(conn.Raw()) client := pb.NewDRPCReferralManagerClient(conn)
_, err = client.RedeemToken(ctx, &pb.RedeemTokenRequest{ _, err = client.RedeemToken(ctx, &pb.RedeemTokenRequest{
Token: referralToken[:], Token: referralToken[:],
RedeemUserId: userID[:], RedeemUserId: userID[:],

View File

@ -23,7 +23,7 @@ func TestVouchers(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
defer ctx.Check(conn.Close) defer ctx.Check(conn.Close)
client := pb.NewDRPCVouchersClient(conn.Raw()) client := pb.NewDRPCVouchersClient(conn)
resp, err := client.Request(ctx, &pb.VoucherRequest{}) resp, err := client.Request(ctx, &pb.VoucherRequest{})
require.Nil(t, resp) require.Nil(t, resp)

View File

@ -26,7 +26,7 @@ func TestStoragenodeContactEndpoint(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
defer ctx.Check(conn.Close) defer ctx.Check(conn.Close)
resp, err := pb.NewDRPCContactClient(conn.Raw()).PingNode(ctx, &pb.ContactPingRequest{}) resp, err := pb.NewDRPCContactClient(conn).PingNode(ctx, &pb.ContactPingRequest{})
require.NotNil(t, resp) require.NotNil(t, resp)
require.NoError(t, err) require.NoError(t, err)
@ -34,7 +34,7 @@ func TestStoragenodeContactEndpoint(t *testing.T) {
time.Sleep(time.Second) //HACKFIX: windows has large time granularity time.Sleep(time.Second) //HACKFIX: windows has large time granularity
resp, err = pb.NewDRPCContactClient(conn.Raw()).PingNode(ctx, &pb.ContactPingRequest{}) resp, err = pb.NewDRPCContactClient(conn).PingNode(ctx, &pb.ContactPingRequest{})
require.NotNil(t, resp) require.NotNil(t, resp)
require.NoError(t, err) require.NoError(t, err)

View File

@ -120,7 +120,7 @@ func (service *Service) pingSatelliteOnce(ctx context.Context, id storj.NodeID)
} }
defer func() { err = errs.Combine(err, conn.Close()) }() defer func() { err = errs.Combine(err, conn.Close()) }()
_, err = pb.NewDRPCNodeClient(conn.Raw()).CheckIn(ctx, &pb.CheckInRequest{ _, err = pb.NewDRPCNodeClient(conn).CheckIn(ctx, &pb.CheckInRequest{
Address: self.Address.GetAddress(), Address: self.Address.GetAddress(),
Version: &self.Version, Version: &self.Version,
Capacity: &self.Capacity, Capacity: &self.Capacity,

View File

@ -74,7 +74,7 @@ func (worker *Worker) Run(ctx context.Context, done func()) (err error) {
err = errs.Combine(err, conn.Close()) err = errs.Combine(err, conn.Close())
}() }()
client := pb.NewDRPCSatelliteGracefulExitClient(conn.Raw()) client := pb.NewDRPCSatelliteGracefulExitClient(conn)
c, err := client.Process(ctx) c, err := client.Process(ctx)
if err != nil { if err != nil {

View File

@ -296,7 +296,7 @@ func (service *Service) dial(ctx context.Context, satelliteID storj.NodeID) (_ *
return &Client{ return &Client{
conn: conn, conn: conn,
DRPCHeldAmountClient: pb.NewDRPCHeldAmountClient(conn.Raw()), DRPCHeldAmountClient: pb.NewDRPCHeldAmountClient(conn),
}, nil }, nil
} }

View File

@ -131,7 +131,7 @@ func (s *Service) dial(ctx context.Context, satelliteID storj.NodeID) (_ *Client
return &Client{ return &Client{
conn: conn, conn: conn,
DRPCNodeStatsClient: pb.NewDRPCNodeStatsClient(conn.Raw()), DRPCNodeStatsClient: pb.NewDRPCNodeStatsClient(conn),
}, nil }, nil
} }

View File

@ -282,7 +282,7 @@ func (service *Service) settle(ctx context.Context, log *zap.Logger, satelliteID
} }
defer func() { err = errs.Combine(err, conn.Close()) }() defer func() { err = errs.Combine(err, conn.Close()) }()
stream, err := pb.NewDRPCOrdersClient(conn.Raw()).Settlement(ctx) stream, err := pb.NewDRPCOrdersClient(conn).Settlement(ctx)
if err != nil { if err != nil {
return OrderError.New("failed to start settlement: %w", err) return OrderError.New("failed to start settlement: %w", err)
} }

View File

@ -115,7 +115,7 @@ func (localTime *LocalTime) getSatelliteTime(ctx context.Context, satelliteID st
err = errs.Combine(err, conn.Close()) err = errs.Combine(err, conn.Close())
}() }()
resp, err := pb.NewDRPCNodeClient(conn.Raw()).GetTime(ctx, &pb.GetTimeRequest{}) resp, err := pb.NewDRPCNodeClient(conn).GetTime(ctx, &pb.GetTimeRequest{})
if err != nil { if err != nil {
return nil, err return nil, err
} }