Skip to content

Commit 4fa1360

Browse files
yacovmghaskins
authored andcommitted
Upgrade go protobuf from 3-beta to 3
We bump the vagrant devenv from 0.0.10 to 0.0.11 to pick up the latest protoc binary. Users will need to vagrant destroy+up to work with this code. This has been tested with a full unit-test/behave cycle in both Jenkins and vagrant (after a destroy/up cycle). https://jira.hyperledger.org/browse/FAB-108 Change-Id: I62bc7925379a7db86b58aa6cca5ddaeb1069456d Signed-off-by: Yacov Manevich <[email protected]> Signed-off-by: Gregory Haskins <[email protected]>
1 parent d8d33c2 commit 4fa1360

File tree

718 files changed

+166697
-4485
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

718 files changed

+166697
-4485
lines changed

consensus/pbft/batch.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ package pbft
1818

1919
import (
2020
"fmt"
21-
"google/protobuf"
2221
"time"
2322

2423
"github.com/hyperledger/fabric/consensus"
2524
"github.com/hyperledger/fabric/consensus/util/events"
2625
pb "github.com/hyperledger/fabric/protos"
2726

2827
"github.com/golang/protobuf/proto"
28+
"github.com/golang/protobuf/ptypes/timestamp"
2929
"github.com/op/go-logging"
3030
"github.com/spf13/viper"
3131
)
@@ -242,7 +242,7 @@ func (op *obcBatch) sendBatch() events.Event {
242242
func (op *obcBatch) txToReq(tx []byte) *Request {
243243
now := time.Now()
244244
req := &Request{
245-
Timestamp: &google_protobuf.Timestamp{
245+
Timestamp: &timestamp.Timestamp{
246246
Seconds: now.Unix(),
247247
Nanos: int32(now.UnixNano() % 1000000000),
248248
},

consensus/pbft/messages.pb.go

+269-83
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

consensus/pbft/mock_utilities_test.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ import (
2525
"github.com/hyperledger/fabric/consensus/util/events"
2626
"github.com/hyperledger/fabric/core/ledger/statemgmt"
2727

28-
gp "google/protobuf"
29-
28+
"github.com/golang/protobuf/ptypes/timestamp"
3029
pb "github.com/hyperledger/fabric/protos"
3130
"github.com/spf13/viper"
3231
)
@@ -105,7 +104,7 @@ func createRunningPbftWithManager(id uint64, config *viper.Viper, stack innerSta
105104
}
106105

107106
func createTx(tag int64) (tx *pb.Transaction) {
108-
txTime := &gp.Timestamp{Seconds: tag, Nanos: 0}
107+
txTime := &timestamp.Timestamp{Seconds: tag, Nanos: 0}
109108
tx = &pb.Transaction{Type: pb.Transaction_CHAINCODE_DEPLOY,
110109
Timestamp: txTime,
111110
Payload: []byte(fmt.Sprint(tag)),

core/admin.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ import (
2424
"github.com/spf13/viper"
2525
"golang.org/x/net/context"
2626

27-
"google/protobuf"
28-
27+
"github.com/golang/protobuf/ptypes/empty"
2928
pb "github.com/hyperledger/fabric/protos"
3029
)
3130

@@ -55,21 +54,21 @@ func worker(id int, die chan struct{}) {
5554
}
5655

5756
// GetStatus reports the status of the server
58-
func (*ServerAdmin) GetStatus(context.Context, *google_protobuf.Empty) (*pb.ServerStatus, error) {
57+
func (*ServerAdmin) GetStatus(context.Context, *empty.Empty) (*pb.ServerStatus, error) {
5958
status := &pb.ServerStatus{Status: pb.ServerStatus_STARTED}
6059
log.Debugf("returning status: %s", status)
6160
return status, nil
6261
}
6362

6463
// StartServer starts the server
65-
func (*ServerAdmin) StartServer(context.Context, *google_protobuf.Empty) (*pb.ServerStatus, error) {
64+
func (*ServerAdmin) StartServer(context.Context, *empty.Empty) (*pb.ServerStatus, error) {
6665
status := &pb.ServerStatus{Status: pb.ServerStatus_STARTED}
6766
log.Debugf("returning status: %s", status)
6867
return status, nil
6968
}
7069

7170
// StopServer stops the server
72-
func (*ServerAdmin) StopServer(context.Context, *google_protobuf.Empty) (*pb.ServerStatus, error) {
71+
func (*ServerAdmin) StopServer(context.Context, *empty.Empty) (*pb.ServerStatus, error) {
7372
status := &pb.ServerStatus{Status: pb.ServerStatus_STOPPED}
7473
log.Debugf("returning status: %s", status)
7574

core/chaincode/shim/chaincode.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ import (
2828
"strconv"
2929
"strings"
3030

31-
gp "google/protobuf"
32-
3331
"github.com/golang/protobuf/proto"
32+
"github.com/golang/protobuf/ptypes/timestamp"
3433
"github.com/hyperledger/fabric/core/chaincode/shim/crypto/attr"
3534
"github.com/hyperledger/fabric/core/chaincode/shim/crypto/ecdsa"
3635
"github.com/hyperledger/fabric/core/comm"
@@ -664,7 +663,7 @@ func (stub *ChaincodeStub) GetPayload() ([]byte, error) {
664663
// GetTxTimestamp returns transaction created timestamp, which is currently
665664
// taken from the peer receiving the transaction. Note that this timestamp
666665
// may not be the same with the other peers' time.
667-
func (stub *ChaincodeStub) GetTxTimestamp() (*gp.Timestamp, error) {
666+
func (stub *ChaincodeStub) GetTxTimestamp() (*timestamp.Timestamp, error) {
668667
return stub.securityContext.TxTimestamp, nil
669668
}
670669

core/chaincode/shim/interfaces.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ limitations under the License.
1818
package shim
1919

2020
import (
21-
gp "google/protobuf"
22-
21+
"github.com/golang/protobuf/ptypes/timestamp"
2322
"github.com/hyperledger/fabric/core/chaincode/shim/crypto/attr"
2423
)
2524

@@ -155,7 +154,7 @@ type ChaincodeStubInterface interface {
155154
// GetTxTimestamp returns transaction created timestamp, which is currently
156155
// taken from the peer receiving the transaction. Note that this timestamp
157156
// may not be the same with the other peers' time.
158-
GetTxTimestamp() (*gp.Timestamp, error)
157+
GetTxTimestamp() (*timestamp.Timestamp, error)
159158

160159
// SetEvent saves the event to be sent when a transaction is made part of a block
161160
SetEvent(name string, payload []byte) error

core/chaincode/shim/mockstub.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ import (
2323
"errors"
2424
"strings"
2525

26-
gp "google/protobuf"
27-
26+
"github.com/golang/protobuf/ptypes/timestamp"
2827
"github.com/hyperledger/fabric/core/chaincode/shim/crypto/attr"
2928
"github.com/op/go-logging"
3029
)
@@ -301,7 +300,7 @@ func (stub *MockStub) GetPayload() ([]byte, error) {
301300
}
302301

303302
// Not implemented
304-
func (stub *MockStub) GetTxTimestamp() (*gp.Timestamp, error) {
303+
func (stub *MockStub) GetTxTimestamp() (*timestamp.Timestamp, error) {
305304
return nil, nil
306305
}
307306

core/chaincode/shim/table.pb.go

+91-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/comm/connection.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const defaultTimeout = time.Second * 3
1616
var commLogger = logging.MustGetLogger("comm")
1717

1818
// NewClientConnectionWithAddress Returns a new grpc.ClientConn to the given address.
19-
func NewClientConnectionWithAddress(peerAddress string, block bool, tslEnabled bool, creds credentials.TransportAuthenticator) (*grpc.ClientConn, error) {
19+
func NewClientConnectionWithAddress(peerAddress string, block bool, tslEnabled bool, creds credentials.TransportCredentials) (*grpc.ClientConn, error) {
2020
var opts []grpc.DialOption
2121
if tslEnabled {
2222
opts = append(opts, grpc.WithTransportCredentials(creds))
@@ -35,12 +35,12 @@ func NewClientConnectionWithAddress(peerAddress string, block bool, tslEnabled b
3535
}
3636

3737
// InitTLSForPeer returns TLS credentials for peer
38-
func InitTLSForPeer() credentials.TransportAuthenticator {
38+
func InitTLSForPeer() credentials.TransportCredentials {
3939
var sn string
4040
if viper.GetString("peer.tls.serverhostoverride") != "" {
4141
sn = viper.GetString("peer.tls.serverhostoverride")
4242
}
43-
var creds credentials.TransportAuthenticator
43+
var creds credentials.TransportCredentials
4444
if viper.GetString("peer.tls.cert.file") != "" {
4545
var err error
4646
creds, err = credentials.NewClientTLSFromFile(viper.GetString("peer.tls.cert.file"), sn)

core/container/dockercontroller/dockercontroller_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ import (
2121
"os"
2222
"testing"
2323

24+
"github.com/fsouza/go-dockerclient"
2425
"github.com/spf13/viper"
2526

26-
"github.com/fsouza/go-dockerclient"
2727
"github.com/hyperledger/fabric/core/config"
2828
"github.com/hyperledger/fabric/core/ledger/testutil"
2929
)

0 commit comments

Comments
 (0)