diff --git a/shim/chaincodeserver.go b/shim/chaincodeserver.go index 2904e967..553198e4 100644 --- a/shim/chaincodeserver.go +++ b/shim/chaincodeserver.go @@ -8,7 +8,7 @@ import ( "errors" "github.com/hyperledger/fabric-chaincode-go/shim/internal" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "google.golang.org/grpc/keepalive" ) diff --git a/shim/handler.go b/shim/handler.go index 9b66a087..0c470a1f 100644 --- a/shim/handler.go +++ b/shim/handler.go @@ -8,8 +8,8 @@ import ( "fmt" "sync" - "github.com/golang/protobuf/proto" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "google.golang.org/protobuf/proto" ) type state string diff --git a/shim/handler_test.go b/shim/handler_test.go index 75a74859..9c5f1332 100644 --- a/shim/handler_test.go +++ b/shim/handler_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/hyperledger/fabric-chaincode-go/shim/internal/mock" - peerpb "github.com/hyperledger/fabric-protos-go/peer" + peerpb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/stretchr/testify/assert" ) diff --git a/shim/interfaces.go b/shim/interfaces.go index 87ecd81d..e655a485 100644 --- a/shim/interfaces.go +++ b/shim/interfaces.go @@ -4,9 +4,9 @@ package shim import ( - "github.com/golang/protobuf/ptypes/timestamp" - "github.com/hyperledger/fabric-protos-go/ledger/queryresult" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + timestamp "google.golang.org/protobuf/types/known/timestamppb" ) // Chaincode interface must be implemented by all chaincodes. The fabric runs diff --git a/shim/internal/client.go b/shim/internal/client.go index 6b6dde0e..3ce649ec 100644 --- a/shim/internal/client.go +++ b/shim/internal/client.go @@ -8,7 +8,7 @@ import ( "crypto/tls" "time" - peerpb "github.com/hyperledger/fabric-protos-go/peer" + peerpb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/grpc/keepalive" diff --git a/shim/internal/client_test.go b/shim/internal/client_test.go index d1af8e3f..c162e1ba 100644 --- a/shim/internal/client_test.go +++ b/shim/internal/client_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/stretchr/testify/assert" "google.golang.org/grpc" "google.golang.org/grpc/keepalive" diff --git a/shim/internal/mock/client_stream.go b/shim/internal/mock/client_stream.go index 2ed61512..4df37cb0 100644 --- a/shim/internal/mock/client_stream.go +++ b/shim/internal/mock/client_stream.go @@ -4,7 +4,7 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) type ClientStream struct { diff --git a/shim/internal/mock/peer_chaincode_stream.go b/shim/internal/mock/peer_chaincode_stream.go index 8e12e863..c75b521f 100644 --- a/shim/internal/mock/peer_chaincode_stream.go +++ b/shim/internal/mock/peer_chaincode_stream.go @@ -4,7 +4,7 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) type PeerChaincodeStream struct { diff --git a/shim/response.go b/shim/response.go index abe62866..0fe29348 100644 --- a/shim/response.go +++ b/shim/response.go @@ -4,7 +4,7 @@ package shim import ( - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) const ( diff --git a/shim/shim.go b/shim/shim.go index fee7c221..f998db96 100644 --- a/shim/shim.go +++ b/shim/shim.go @@ -13,9 +13,9 @@ import ( "os" "unicode/utf8" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-chaincode-go/shim/internal" - peerpb "github.com/hyperledger/fabric-protos-go/peer" + peerpb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "google.golang.org/protobuf/proto" ) const ( diff --git a/shim/shim_test.go b/shim/shim_test.go index 44183f74..14cd7bfe 100644 --- a/shim/shim_test.go +++ b/shim/shim_test.go @@ -10,7 +10,7 @@ import ( "testing" "github.com/hyperledger/fabric-chaincode-go/shim/internal/mock" - peerpb "github.com/hyperledger/fabric-protos-go/peer" + peerpb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/stretchr/testify/assert" ) diff --git a/shim/stub.go b/shim/stub.go index fafaacf5..59ff7ab4 100644 --- a/shim/stub.go +++ b/shim/stub.go @@ -11,11 +11,11 @@ import ( "os" "unicode/utf8" - "github.com/golang/protobuf/proto" - "github.com/golang/protobuf/ptypes/timestamp" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/queryresult" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "google.golang.org/protobuf/proto" + timestamp "google.golang.org/protobuf/types/known/timestamppb" ) // ChaincodeStub is an object passed to chaincode for shim side handling of diff --git a/shim/stub_test.go b/shim/stub_test.go index bc98705a..92439576 100644 --- a/shim/stub_test.go +++ b/shim/stub_test.go @@ -9,15 +9,14 @@ import ( "os" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-chaincode-go/shim/internal/mock" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/queryresult" - peerpb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult" + peerpb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "google.golang.org/protobuf/proto" - "github.com/golang/protobuf/ptypes" - "github.com/golang/protobuf/ptypes/timestamp" "github.com/stretchr/testify/assert" + timestamp "google.golang.org/protobuf/types/known/timestamppb" ) func toChaincodeArgs(args ...string) [][]byte { @@ -193,7 +192,7 @@ func TestChaincodeStubAccessors(t *testing.T) { } func TestChaincodeStubGetTxTimestamp(t *testing.T) { - now := ptypes.TimestampNow() + now := timestamp.Now() tests := []struct { proposal *peerpb.Proposal ts *timestamp.Timestamp diff --git a/shimtest/mock/chaincode.go b/shimtest/mock/chaincode.go index 6ad21a10..33aabe67 100644 --- a/shimtest/mock/chaincode.go +++ b/shimtest/mock/chaincode.go @@ -5,7 +5,7 @@ import ( "sync" "github.com/hyperledger/fabric-chaincode-go/shim" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) type Chaincode struct { diff --git a/shimtest/mockstub.go b/shimtest/mockstub.go index 6e36fe7c..c0709436 100644 --- a/shimtest/mockstub.go +++ b/shimtest/mockstub.go @@ -16,12 +16,11 @@ import ( "strings" "unicode/utf8" - "github.com/golang/protobuf/proto" - "github.com/golang/protobuf/ptypes" - "github.com/golang/protobuf/ptypes/timestamp" "github.com/hyperledger/fabric-chaincode-go/shim" - "github.com/hyperledger/fabric-protos-go/ledger/queryresult" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "google.golang.org/protobuf/proto" + timestamp "google.golang.org/protobuf/types/known/timestamppb" ) const ( @@ -121,7 +120,7 @@ func (stub *MockStub) GetFunctionAndParameters() (function string, params []stri func (stub *MockStub) MockTransactionStart(txid string) { stub.TxID = txid stub.setSignedProposal(&pb.SignedProposal{}) - stub.setTxTimestamp(ptypes.TimestampNow()) + stub.setTxTimestamp(timestamp.Now()) } // MockTransactionEnd End a mocked transaction, clearing the UUID.