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

try to update to v2 api #3529

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ PROJECT_VERSION=$(BASE_VERSION)-snapshot-$(EXTRA_VERSION)
# for two digit references to most recent baseos and ccenv patch releases
TWO_DIGIT_VERSION = $(shell echo $(BASE_VERSION) | cut -d '.' -f 1,2)

PKGNAME = github.com/hyperledger/fabric
PKGNAME = github.com/hyperledger/fabric/v2
ARCH=$(shell go env GOARCH)
MARCH=$(shell go env GOOS)-$(shell go env GOARCH)

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

"github.com/hyperledger/fabric/bccsp"
"github.com/hyperledger/fabric/common/flogging"
"github.com/hyperledger/fabric/v2/bccsp"
"github.com/hyperledger/fabric/v2/common/flogging"
"github.com/pkg/errors"
)

Expand Down
2 changes: 1 addition & 1 deletion bccsp/factory/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"strings"
"testing"

"github.com/hyperledger/fabric/bccsp/pkcs11"
"github.com/hyperledger/fabric/v2/bccsp/pkcs11"
"github.com/spf13/viper"
"github.com/stretchr/testify/require"
)
Expand Down
2 changes: 1 addition & 1 deletion bccsp/factory/nopkcs11.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SPDX-License-Identifier: Apache-2.0
package factory

import (
"github.com/hyperledger/fabric/bccsp"
"github.com/hyperledger/fabric/v2/bccsp"
"github.com/pkg/errors"
)

Expand Down
4 changes: 2 additions & 2 deletions bccsp/factory/pkcs11.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ SPDX-License-Identifier: Apache-2.0
package factory

import (
"github.com/hyperledger/fabric/bccsp"
"github.com/hyperledger/fabric/bccsp/pkcs11"
"github.com/hyperledger/fabric/v2/bccsp"
"github.com/hyperledger/fabric/v2/bccsp/pkcs11"
"github.com/pkg/errors"
)

Expand Down
2 changes: 1 addition & 1 deletion bccsp/factory/pkcs11_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"os"
"testing"

"github.com/hyperledger/fabric/bccsp/pkcs11"
"github.com/hyperledger/fabric/v2/bccsp/pkcs11"
"github.com/stretchr/testify/require"
)

Expand Down
6 changes: 3 additions & 3 deletions bccsp/factory/pkcs11factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ package factory
import (
"encoding/hex"

"github.com/hyperledger/fabric/bccsp"
"github.com/hyperledger/fabric/bccsp/pkcs11"
"github.com/hyperledger/fabric/bccsp/sw"
"github.com/hyperledger/fabric/v2/bccsp"
"github.com/hyperledger/fabric/v2/bccsp/pkcs11"
"github.com/hyperledger/fabric/v2/bccsp/sw"
"github.com/pkg/errors"
)

Expand Down
2 changes: 1 addition & 1 deletion bccsp/factory/pkcs11factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"encoding/hex"
"testing"

"github.com/hyperledger/fabric/bccsp/pkcs11"
"github.com/hyperledger/fabric/v2/bccsp/pkcs11"
"github.com/stretchr/testify/require"
)

Expand Down
4 changes: 2 additions & 2 deletions bccsp/factory/swfactory.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ limitations under the License.
package factory

import (
"github.com/hyperledger/fabric/bccsp"
"github.com/hyperledger/fabric/bccsp/sw"
"github.com/hyperledger/fabric/v2/bccsp"
"github.com/hyperledger/fabric/v2/bccsp/sw"
"github.com/pkg/errors"
)

Expand Down
2 changes: 1 addition & 1 deletion bccsp/mocks/mocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"hash"
"reflect"

"github.com/hyperledger/fabric/bccsp"
"github.com/hyperledger/fabric/v2/bccsp"
)

type MockBCCSP struct {
Expand Down
2 changes: 1 addition & 1 deletion bccsp/pkcs11/ecdsakey.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"errors"
"fmt"

"github.com/hyperledger/fabric/bccsp"
"github.com/hyperledger/fabric/v2/bccsp"
)

type ecdsaPrivateKey struct {
Expand Down
8 changes: 4 additions & 4 deletions bccsp/pkcs11/pkcs11.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import (
"sync"
"time"

"github.com/hyperledger/fabric/bccsp"
"github.com/hyperledger/fabric/bccsp/sw"
"github.com/hyperledger/fabric/bccsp/utils"
"github.com/hyperledger/fabric/common/flogging"
"github.com/hyperledger/fabric/v2/bccsp"
"github.com/hyperledger/fabric/v2/bccsp/sw"
"github.com/hyperledger/fabric/v2/bccsp/utils"
"github.com/hyperledger/fabric/v2/common/flogging"
"github.com/miekg/pkcs11"
"github.com/pkg/errors"
"go.uber.org/zap/zapcore"
Expand Down
6 changes: 3 additions & 3 deletions bccsp/pkcs11/pkcs11_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import (
"testing"
"time"

"github.com/hyperledger/fabric/bccsp"
"github.com/hyperledger/fabric/bccsp/sw"
"github.com/hyperledger/fabric/bccsp/utils"
"github.com/hyperledger/fabric/v2/bccsp"
"github.com/hyperledger/fabric/v2/bccsp/sw"
"github.com/hyperledger/fabric/v2/bccsp/utils"
"github.com/miekg/pkcs11"
"github.com/stretchr/testify/require"
)
Expand Down
2 changes: 1 addition & 1 deletion bccsp/signer/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"crypto/x509"
"io"

"github.com/hyperledger/fabric/bccsp"
"github.com/hyperledger/fabric/v2/bccsp"
"github.com/pkg/errors"
)

Expand Down
2 changes: 1 addition & 1 deletion bccsp/signer/signer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"errors"
"testing"

"github.com/hyperledger/fabric/bccsp/mocks"
"github.com/hyperledger/fabric/v2/bccsp/mocks"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion bccsp/sw/aes.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"fmt"
"io"

"github.com/hyperledger/fabric/bccsp"
"github.com/hyperledger/fabric/v2/bccsp"
)

// GetRandomBytes returns len random looking bytes
Expand Down
4 changes: 2 additions & 2 deletions bccsp/sw/aes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
mrand "math/rand"
"testing"

"github.com/hyperledger/fabric/bccsp"
"github.com/hyperledger/fabric/bccsp/mocks"
"github.com/hyperledger/fabric/v2/bccsp"
"github.com/hyperledger/fabric/v2/bccsp/mocks"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion bccsp/sw/aeskey.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"crypto/sha256"
"errors"

"github.com/hyperledger/fabric/bccsp"
"github.com/hyperledger/fabric/v2/bccsp"
)

type aesPrivateKey struct {
Expand Down
2 changes: 1 addition & 1 deletion bccsp/sw/dummyks.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package sw
import (
"errors"

"github.com/hyperledger/fabric/bccsp"
"github.com/hyperledger/fabric/v2/bccsp"
)

// NewDummyKeyStore instantiate a dummy key store
Expand Down
2 changes: 1 addition & 1 deletion bccsp/sw/dummyks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package sw
import (
"testing"

"github.com/hyperledger/fabric/bccsp/mocks"
"github.com/hyperledger/fabric/v2/bccsp/mocks"
"github.com/stretchr/testify/require"
)

Expand Down
4 changes: 2 additions & 2 deletions bccsp/sw/ecdsa.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"crypto/rand"
"fmt"

"github.com/hyperledger/fabric/bccsp"
"github.com/hyperledger/fabric/bccsp/utils"
"github.com/hyperledger/fabric/v2/bccsp"
"github.com/hyperledger/fabric/v2/bccsp/utils"
)

func signECDSA(k *ecdsa.PrivateKey, digest []byte, opts bccsp.SignerOpts) ([]byte, error) {
Expand Down
2 changes: 1 addition & 1 deletion bccsp/sw/ecdsa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"math/big"
"testing"

"github.com/hyperledger/fabric/bccsp/utils"
"github.com/hyperledger/fabric/v2/bccsp/utils"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion bccsp/sw/ecdsakey.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"errors"
"fmt"

"github.com/hyperledger/fabric/bccsp"
"github.com/hyperledger/fabric/v2/bccsp"
)

type ecdsaPrivateKey struct {
Expand Down
4 changes: 2 additions & 2 deletions bccsp/sw/enc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"reflect"
"testing"

mocks2 "github.com/hyperledger/fabric/bccsp/mocks"
"github.com/hyperledger/fabric/bccsp/sw/mocks"
mocks2 "github.com/hyperledger/fabric/v2/bccsp/mocks"
"github.com/hyperledger/fabric/v2/bccsp/sw/mocks"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion bccsp/sw/fileks.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"strings"
"sync"

"github.com/hyperledger/fabric/bccsp"
"github.com/hyperledger/fabric/v2/bccsp"
)

// NewFileBasedKeyStore instantiated a file-based key store at a given position.
Expand Down
2 changes: 1 addition & 1 deletion bccsp/sw/hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package sw
import (
"hash"

"github.com/hyperledger/fabric/bccsp"
"github.com/hyperledger/fabric/v2/bccsp"
)

type hasher struct {
Expand Down
4 changes: 2 additions & 2 deletions bccsp/sw/hash_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"reflect"
"testing"

mocks2 "github.com/hyperledger/fabric/bccsp/mocks"
"github.com/hyperledger/fabric/bccsp/sw/mocks"
mocks2 "github.com/hyperledger/fabric/v2/bccsp/mocks"
"github.com/hyperledger/fabric/v2/bccsp/sw/mocks"
"github.com/stretchr/testify/require"
)

Expand Down
4 changes: 2 additions & 2 deletions bccsp/sw/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"hash"
"reflect"

"github.com/hyperledger/fabric/bccsp"
"github.com/hyperledger/fabric/common/flogging"
"github.com/hyperledger/fabric/v2/bccsp"
"github.com/hyperledger/fabric/v2/common/flogging"
"github.com/pkg/errors"
)

Expand Down
8 changes: 4 additions & 4 deletions bccsp/sw/impl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ import (
"testing"
"time"

"github.com/hyperledger/fabric/bccsp"
"github.com/hyperledger/fabric/bccsp/signer"
"github.com/hyperledger/fabric/bccsp/sw/mocks"
"github.com/hyperledger/fabric/bccsp/utils"
"github.com/hyperledger/fabric/v2/bccsp"
"github.com/hyperledger/fabric/v2/bccsp/signer"
"github.com/hyperledger/fabric/v2/bccsp/sw/mocks"
"github.com/hyperledger/fabric/v2/bccsp/utils"
"github.com/stretchr/testify/require"
"golang.org/x/crypto/sha3"
)
Expand Down
2 changes: 1 addition & 1 deletion bccsp/sw/internals.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package sw
import (
"hash"

"github.com/hyperledger/fabric/bccsp"
"github.com/hyperledger/fabric/v2/bccsp"
)

// KeyGenerator is a BCCSP-like interface that provides key generation algorithms
Expand Down
2 changes: 1 addition & 1 deletion bccsp/sw/keyderiv.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"fmt"
"math/big"

"github.com/hyperledger/fabric/bccsp"
"github.com/hyperledger/fabric/v2/bccsp"
)

type ecdsaPublicKeyKeyDeriver struct{}
Expand Down
4 changes: 2 additions & 2 deletions bccsp/sw/keyderiv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"reflect"
"testing"

mocks2 "github.com/hyperledger/fabric/bccsp/mocks"
"github.com/hyperledger/fabric/bccsp/sw/mocks"
mocks2 "github.com/hyperledger/fabric/v2/bccsp/mocks"
"github.com/hyperledger/fabric/v2/bccsp/sw/mocks"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion bccsp/sw/keygen.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"crypto/rand"
"fmt"

"github.com/hyperledger/fabric/bccsp"
"github.com/hyperledger/fabric/v2/bccsp"
)

type ecdsaKeyGenerator struct {
Expand Down
4 changes: 2 additions & 2 deletions bccsp/sw/keygen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"reflect"
"testing"

mocks2 "github.com/hyperledger/fabric/bccsp/mocks"
"github.com/hyperledger/fabric/bccsp/sw/mocks"
mocks2 "github.com/hyperledger/fabric/v2/bccsp/mocks"
"github.com/hyperledger/fabric/v2/bccsp/sw/mocks"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion bccsp/sw/keyimport.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"fmt"
"reflect"

"github.com/hyperledger/fabric/bccsp"
"github.com/hyperledger/fabric/v2/bccsp"
)

type aes256ImportKeyOptsKeyImporter struct{}
Expand Down
4 changes: 2 additions & 2 deletions bccsp/sw/keyimport_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"reflect"
"testing"

mocks2 "github.com/hyperledger/fabric/bccsp/mocks"
"github.com/hyperledger/fabric/bccsp/sw/mocks"
mocks2 "github.com/hyperledger/fabric/v2/bccsp/mocks"
"github.com/hyperledger/fabric/v2/bccsp/sw/mocks"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion bccsp/sw/mocks/mocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"hash"
"reflect"

"github.com/hyperledger/fabric/bccsp"
"github.com/hyperledger/fabric/v2/bccsp"
)

type Encryptor struct {
Expand Down
2 changes: 1 addition & 1 deletion bccsp/sw/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"crypto/sha512"
"reflect"

"github.com/hyperledger/fabric/bccsp"
"github.com/hyperledger/fabric/v2/bccsp"
"github.com/pkg/errors"
"golang.org/x/crypto/sha3"
)
Expand Down
2 changes: 1 addition & 1 deletion bccsp/sw/rsa.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"errors"
"fmt"

"github.com/hyperledger/fabric/bccsp"
"github.com/hyperledger/fabric/v2/bccsp"
)

// An rsaPublicKey wraps the standard library implementation of an RSA public
Expand Down