Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update libs #4970

Merged
merged 3 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion cmd/common/signer/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"strings"

"github.com/hyperledger/fabric-lib-go/bccsp/utils"
"github.com/hyperledger/fabric-protos-go/msp"
"github.com/hyperledger/fabric-protos-go-apiv2/msp"
"github.com/hyperledger/fabric/common/util"
"github.com/hyperledger/fabric/protoutil"
"github.com/pkg/errors"
Expand Down
2 changes: 1 addition & 1 deletion cmd/configtxgen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/hyperledger/fabric-config/protolator/protoext/peerext"
"github.com/hyperledger/fabric-lib-go/bccsp/factory"
"github.com/hyperledger/fabric-lib-go/common/flogging"
cb "github.com/hyperledger/fabric-protos-go/common"
cb "github.com/hyperledger/fabric-protos-go-apiv2/common"
"github.com/hyperledger/fabric/internal/configtxgen/encoder"
"github.com/hyperledger/fabric/internal/configtxgen/genesisconfig"
"github.com/hyperledger/fabric/internal/configtxgen/metadata"
Expand Down
22 changes: 14 additions & 8 deletions cmd/configtxlator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ import (
"os"
"reflect"

"github.com/golang/protobuf/proto"
"github.com/gorilla/handlers"
"github.com/hyperledger/fabric-config/protolator"
"github.com/hyperledger/fabric-lib-go/common/flogging"
cb "github.com/hyperledger/fabric-protos-go/common"
_ "github.com/hyperledger/fabric-protos-go/msp"
_ "github.com/hyperledger/fabric-protos-go/orderer"
_ "github.com/hyperledger/fabric-protos-go/orderer/etcdraft"
_ "github.com/hyperledger/fabric-protos-go/peer"
cb "github.com/hyperledger/fabric-protos-go-apiv2/common"
_ "github.com/hyperledger/fabric-protos-go-apiv2/msp"
_ "github.com/hyperledger/fabric-protos-go-apiv2/orderer"
_ "github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft"
_ "github.com/hyperledger/fabric-protos-go-apiv2/peer"
"github.com/hyperledger/fabric/internal/configtxlator/metadata"
"github.com/hyperledger/fabric/internal/configtxlator/rest"
"github.com/hyperledger/fabric/internal/configtxlator/update"
"github.com/pkg/errors"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/reflect/protoreflect"
"google.golang.org/protobuf/reflect/protoregistry"
"gopkg.in/alecthomas/kingpin.v2"
Expand Down Expand Up @@ -131,7 +131,7 @@ func encodeProto(msgName string, input, output *os.File) error {
return errors.Wrapf(err, "error encode input")
}

msgType := reflect.TypeOf(proto.MessageV1(mt.Zero().Interface()))
msgType := reflect.TypeOf(mt.Zero().Interface())

if msgType == nil {
return errors.Errorf("message of type %s unknown", msgType)
Expand All @@ -143,6 +143,9 @@ func encodeProto(msgName string, input, output *os.File) error {
return errors.Wrapf(err, "error decoding input")
}

if msg == nil {
return errors.New("error marshaling: proto: Marshal called with nil")
}
out, err := proto.Marshal(msg)
if err != nil {
return errors.Wrapf(err, "error marshaling")
Expand All @@ -162,7 +165,7 @@ func decodeProto(msgName string, input, output *os.File) error {
return errors.Wrapf(err, "error encode input")
}

msgType := reflect.TypeOf(proto.MessageV1(mt.Zero().Interface()))
msgType := reflect.TypeOf(mt.Zero().Interface())

if msgType == nil {
return errors.Errorf("message of type %s unknown", msgType)
Expand Down Expand Up @@ -217,6 +220,9 @@ func computeUpdt(original, updated, output *os.File, channelID string) error {

cu.ChannelId = channelID

if cu == nil {
return errors.New("error marshaling computed config update: proto: Marshal called with nil")
}
outBytes, err := proto.Marshal(cu)
if err != nil {
return errors.Wrapf(err, "error marshaling computed config update")
Expand Down
4 changes: 2 additions & 2 deletions cmd/osnadmin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import (
"net/http"
"os"

"github.com/golang/protobuf/proto"
"github.com/hyperledger/fabric-protos-go/common"
"github.com/hyperledger/fabric-protos-go-apiv2/common"
"github.com/hyperledger/fabric/internal/osnadmin"
"github.com/hyperledger/fabric/protoutil"
"google.golang.org/protobuf/proto"
"gopkg.in/alecthomas/kingpin.v2"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/osnadmin/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ import (
"os"
"path/filepath"

"github.com/golang/protobuf/proto"
"github.com/hyperledger/fabric-lib-go/bccsp"
cb "github.com/hyperledger/fabric-protos-go/common"
cb "github.com/hyperledger/fabric-protos-go-apiv2/common"
"github.com/hyperledger/fabric/cmd/osnadmin/mocks"
"github.com/hyperledger/fabric/common/crypto/tlsgen"
"github.com/hyperledger/fabric/orderer/common/channelparticipation"
Expand All @@ -29,6 +28,7 @@ import (
"github.com/hyperledger/fabric/protoutil"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"google.golang.org/protobuf/proto"
)

var _ = Describe("osnadmin", func() {
Expand Down
2 changes: 1 addition & 1 deletion cmd/osnadmin/mocks/channel_management.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/osnadmin/osnadmin_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package main
import (
"testing"

cb "github.com/hyperledger/fabric-protos-go/common"
cb "github.com/hyperledger/fabric-protos-go-apiv2/common"
"github.com/hyperledger/fabric/orderer/common/types"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
Expand Down
2 changes: 1 addition & 1 deletion common/capabilities/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0
package capabilities

import (
cb "github.com/hyperledger/fabric-protos-go/common"
cb "github.com/hyperledger/fabric-protos-go-apiv2/common"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion common/capabilities/application_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package capabilities
import (
"testing"

cb "github.com/hyperledger/fabric-protos-go/common"
cb "github.com/hyperledger/fabric-protos-go-apiv2/common"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion common/capabilities/capabilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package capabilities

import (
"github.com/hyperledger/fabric-lib-go/common/flogging"
cb "github.com/hyperledger/fabric-protos-go/common"
cb "github.com/hyperledger/fabric-protos-go-apiv2/common"
"github.com/pkg/errors"
)

Expand Down
2 changes: 1 addition & 1 deletion common/capabilities/capabilities_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package capabilities
import (
"testing"

cb "github.com/hyperledger/fabric-protos-go/common"
cb "github.com/hyperledger/fabric-protos-go-apiv2/common"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion common/capabilities/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0
package capabilities

import (
cb "github.com/hyperledger/fabric-protos-go/common"
cb "github.com/hyperledger/fabric-protos-go-apiv2/common"
"github.com/hyperledger/fabric/msp"
)

Expand Down
2 changes: 1 addition & 1 deletion common/capabilities/channel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package capabilities
import (
"testing"

cb "github.com/hyperledger/fabric-protos-go/common"
cb "github.com/hyperledger/fabric-protos-go-apiv2/common"
"github.com/hyperledger/fabric/msp"
"github.com/stretchr/testify/require"
)
Expand Down
2 changes: 1 addition & 1 deletion common/capabilities/orderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0
package capabilities

import (
cb "github.com/hyperledger/fabric-protos-go/common"
cb "github.com/hyperledger/fabric-protos-go-apiv2/common"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion common/capabilities/orderer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package capabilities
import (
"testing"

cb "github.com/hyperledger/fabric-protos-go/common"
cb "github.com/hyperledger/fabric-protos-go-apiv2/common"
"github.com/stretchr/testify/require"
)

Expand Down
4 changes: 2 additions & 2 deletions common/cauthdsl/cauthdsl.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"time"

"github.com/hyperledger/fabric-lib-go/common/flogging"
cb "github.com/hyperledger/fabric-protos-go/common"
mb "github.com/hyperledger/fabric-protos-go/msp"
cb "github.com/hyperledger/fabric-protos-go-apiv2/common"
mb "github.com/hyperledger/fabric-protos-go-apiv2/msp"
"github.com/hyperledger/fabric/msp"
"go.uber.org/zap/zapcore"
)
Expand Down
6 changes: 3 additions & 3 deletions common/cauthdsl/cauthdsl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import (
"testing"
"time"

"github.com/golang/protobuf/proto"
cb "github.com/hyperledger/fabric-protos-go/common"
mb "github.com/hyperledger/fabric-protos-go/msp"
cb "github.com/hyperledger/fabric-protos-go-apiv2/common"
mb "github.com/hyperledger/fabric-protos-go-apiv2/msp"
"github.com/hyperledger/fabric/common/policydsl"
"github.com/hyperledger/fabric/msp"
"github.com/stretchr/testify/require"
"google.golang.org/protobuf/proto"
)

var invalidSignature = []byte("badsigned")
Expand Down
4 changes: 2 additions & 2 deletions common/cauthdsl/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ package cauthdsl
import (
"fmt"

"github.com/golang/protobuf/proto"
cb "github.com/hyperledger/fabric-protos-go/common"
cb "github.com/hyperledger/fabric-protos-go-apiv2/common"
"github.com/hyperledger/fabric/common/policies"
"github.com/hyperledger/fabric/msp"
"github.com/hyperledger/fabric/protoutil"
"github.com/pkg/errors"
"google.golang.org/protobuf/proto"
)

type provider struct {
Expand Down
4 changes: 2 additions & 2 deletions common/cauthdsl/policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import (
"fmt"
"testing"

"github.com/golang/protobuf/proto"
cb "github.com/hyperledger/fabric-protos-go/common"
cb "github.com/hyperledger/fabric-protos-go-apiv2/common"
"github.com/hyperledger/fabric/common/policies"
"github.com/hyperledger/fabric/common/policydsl"
"github.com/hyperledger/fabric/protoutil"
"github.com/stretchr/testify/require"
"google.golang.org/protobuf/proto"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions common/chaincode/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ package chaincode
import (
"sync"

"github.com/hyperledger/fabric-protos-go/gossip"
"github.com/hyperledger/fabric-protos-go/peer"
"github.com/hyperledger/fabric-protos-go-apiv2/gossip"
"github.com/hyperledger/fabric-protos-go-apiv2/peer"
)

// InstalledChaincode defines metadata about an installed chaincode
Expand Down
2 changes: 1 addition & 1 deletion common/chaincode/metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package chaincode
import (
"testing"

"github.com/hyperledger/fabric-protos-go/gossip"
"github.com/hyperledger/fabric-protos-go-apiv2/gossip"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion common/channelconfig/acls.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0
package channelconfig

import (
pb "github.com/hyperledger/fabric-protos-go/peer"
pb "github.com/hyperledger/fabric-protos-go-apiv2/peer"
)

// aclsProvider provides mappings for resource to policy names
Expand Down
2 changes: 1 addition & 1 deletion common/channelconfig/acls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package channelconfig
import (
"testing"

pb "github.com/hyperledger/fabric-protos-go/peer"
pb "github.com/hyperledger/fabric-protos-go-apiv2/peer"
"github.com/stretchr/testify/require"
)

Expand Down
6 changes: 3 additions & 3 deletions common/channelconfig/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ package channelconfig
import (
"time"

cb "github.com/hyperledger/fabric-protos-go/common"
ab "github.com/hyperledger/fabric-protos-go/orderer"
pb "github.com/hyperledger/fabric-protos-go/peer"
cb "github.com/hyperledger/fabric-protos-go-apiv2/common"
ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer"
pb "github.com/hyperledger/fabric-protos-go-apiv2/peer"
"github.com/hyperledger/fabric/common/configtx"
"github.com/hyperledger/fabric/common/policies"
"github.com/hyperledger/fabric/msp"
Expand Down
4 changes: 2 additions & 2 deletions common/channelconfig/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ SPDX-License-Identifier: Apache-2.0
package channelconfig

import (
cb "github.com/hyperledger/fabric-protos-go/common"
pb "github.com/hyperledger/fabric-protos-go/peer"
cb "github.com/hyperledger/fabric-protos-go-apiv2/common"
pb "github.com/hyperledger/fabric-protos-go-apiv2/peer"
"github.com/hyperledger/fabric/common/capabilities"
"github.com/pkg/errors"
)
Expand Down
4 changes: 2 additions & 2 deletions common/channelconfig/application_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ package channelconfig
import (
"testing"

"github.com/golang/protobuf/proto"
cb "github.com/hyperledger/fabric-protos-go/common"
cb "github.com/hyperledger/fabric-protos-go-apiv2/common"
"github.com/hyperledger/fabric/common/capabilities"
"github.com/hyperledger/fabric/protoutil"
. "github.com/onsi/gomega"
"google.golang.org/protobuf/proto"
)

func TestApplicationInterface(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions common/channelconfig/applicationorg.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ package channelconfig
import (
"fmt"

cb "github.com/hyperledger/fabric-protos-go/common"
pb "github.com/hyperledger/fabric-protos-go/peer"
cb "github.com/hyperledger/fabric-protos-go-apiv2/common"
pb "github.com/hyperledger/fabric-protos-go-apiv2/peer"
"github.com/pkg/errors"
)

Expand Down
2 changes: 1 addition & 1 deletion common/channelconfig/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package channelconfig
import (
"github.com/hyperledger/fabric-lib-go/bccsp"
"github.com/hyperledger/fabric-lib-go/common/flogging"
cb "github.com/hyperledger/fabric-protos-go/common"
cb "github.com/hyperledger/fabric-protos-go-apiv2/common"
"github.com/hyperledger/fabric/common/cauthdsl"
"github.com/hyperledger/fabric/common/configtx"
"github.com/hyperledger/fabric/common/policies"
Expand Down
4 changes: 2 additions & 2 deletions common/channelconfig/bundle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ package channelconfig
import (
"testing"

cb "github.com/hyperledger/fabric-protos-go/common"
ab "github.com/hyperledger/fabric-protos-go/orderer"
cb "github.com/hyperledger/fabric-protos-go-apiv2/common"
ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer"
cc "github.com/hyperledger/fabric/common/capabilities"
"github.com/stretchr/testify/require"
)
Expand Down
2 changes: 1 addition & 1 deletion common/channelconfig/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"math"

"github.com/hyperledger/fabric-lib-go/bccsp"
cb "github.com/hyperledger/fabric-protos-go/common"
cb "github.com/hyperledger/fabric-protos-go-apiv2/common"
"github.com/hyperledger/fabric/common/capabilities"
"github.com/hyperledger/fabric/common/util"
"github.com/hyperledger/fabric/msp"
Expand Down
2 changes: 1 addition & 1 deletion common/channelconfig/channel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

"github.com/hyperledger/fabric-lib-go/bccsp"
"github.com/hyperledger/fabric-lib-go/bccsp/sw"
cb "github.com/hyperledger/fabric-protos-go/common"
cb "github.com/hyperledger/fabric-protos-go-apiv2/common"
"github.com/hyperledger/fabric/common/util"
"github.com/stretchr/testify/require"
)
Expand Down
2 changes: 1 addition & 1 deletion common/channelconfig/consortium.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0
package channelconfig

import (
cb "github.com/hyperledger/fabric-protos-go/common"
cb "github.com/hyperledger/fabric-protos-go-apiv2/common"
"github.com/pkg/errors"
)

Expand Down
Loading