Skip to content

Commit

Permalink
add new version libs
Browse files Browse the repository at this point in the history
Signed-off-by: Fedor Partanskiy <[email protected]>
  • Loading branch information
pfi79 committed Aug 29, 2024
1 parent 2aadc73 commit 7a3a573
Show file tree
Hide file tree
Showing 1,252 changed files with 49,770 additions and 30,012 deletions.
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

0 comments on commit 7a3a573

Please sign in to comment.