Skip to content

Commit b97d023

Browse files
refactor(fabric): remove import of fabric/msp
This commit moves msp imported from fabric into a local package, including tests. Signed-off-by: Marcus Brandenburger <bur@zurich.ibm.com>
1 parent 256479e commit b97d023

File tree

249 files changed

+10660
-33
lines changed

Some content is hidden

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

249 files changed

+10660
-33
lines changed

integration/nwo/cmd/cryptogen/msp/msp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"github.com/hyperledger-labs/fabric-smart-client/integration/nwo/common/pkcs11"
1919
"github.com/hyperledger-labs/fabric-smart-client/pkg/utils/errors"
2020
"github.com/hyperledger-labs/fabric-smart-client/platform/common/utils"
21-
fabricmsp "github.com/hyperledger/fabric/msp"
21+
fabricmsp "github.com/hyperledger-labs/fabric-smart-client/platform/fabric/msp"
2222
"gopkg.in/yaml.v2"
2323
)
2424

integration/nwo/cmd/cryptogen/msp/msp_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
ca2 "github.com/hyperledger-labs/fabric-smart-client/integration/nwo/cmd/cryptogen/ca"
1515
msp2 "github.com/hyperledger-labs/fabric-smart-client/integration/nwo/cmd/cryptogen/msp"
1616
"github.com/hyperledger-labs/fabric-smart-client/platform/common/utils"
17-
fabricmsp "github.com/hyperledger/fabric/msp"
17+
fabricmsp "github.com/hyperledger-labs/fabric-smart-client/platform/fabric/msp"
1818
"github.com/stretchr/testify/assert"
1919
"gopkg.in/yaml.v2"
2020
)

integration/nwo/fabric/identity/identity.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010
"path/filepath"
1111

1212
"github.com/hyperledger-labs/fabric-smart-client/pkg/utils/errors"
13+
"github.com/hyperledger-labs/fabric-smart-client/platform/fabric/msp"
1314
"github.com/hyperledger/fabric-lib-go/bccsp/sw"
14-
"github.com/hyperledger/fabric/msp"
1515
)
1616

1717
//go:generate counterfeiter -o client/mock/identity.go -fake-name Identity . Identity

platform/fabric/core/generic/id/info_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ import (
1212

1313
idemix2 "github.com/hyperledger-labs/fabric-smart-client/platform/fabric/core/generic/msp/idemix"
1414
x5092 "github.com/hyperledger-labs/fabric-smart-client/platform/fabric/core/generic/msp/x509"
15+
fabricmsp "github.com/hyperledger-labs/fabric-smart-client/platform/fabric/msp"
1516
sig2 "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/sig"
1617
mem "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/storage/driver/memory"
1718
"github.com/hyperledger-labs/fabric-smart-client/platform/view/services/storage/kvs"
18-
msp2 "github.com/hyperledger/fabric/msp"
1919
"github.com/stretchr/testify/assert"
2020
)
2121

@@ -31,7 +31,7 @@ func TestInfoIdemix(t *testing.T) {
3131
assert.NoError(t, err)
3232
sigService := sig2.NewService(sig2.NewMultiplexDeserializer(), auditInfo, signerInfo)
3333

34-
config, err := msp2.GetLocalMspConfigWithType("./testdata/idemix", nil, "idemix", "idemix")
34+
config, err := fabricmsp.GetLocalMspConfigWithType("./testdata/idemix", nil, "idemix", "idemix")
3535
assert.NoError(t, err)
3636

3737
p, err := idemix2.NewProviderWithEidRhNymPolicy(config, kvss, sigService)

platform/fabric/core/generic/membership/channelconfig/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ package channelconfig
99
import (
1010
"time"
1111

12+
"github.com/hyperledger-labs/fabric-smart-client/platform/fabric/msp"
1213
cb "github.com/hyperledger/fabric-protos-go-apiv2/common"
1314
ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer"
1415
pb "github.com/hyperledger/fabric-protos-go-apiv2/peer"
15-
"github.com/hyperledger/fabric/msp"
1616
)
1717

1818
// Org stores the common organizational config

platform/fabric/core/generic/membership/channelconfig/capabilities/channel.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ SPDX-License-Identifier: Apache-2.0
77
package capabilities
88

99
import (
10+
"github.com/hyperledger-labs/fabric-smart-client/platform/fabric/msp"
1011
cb "github.com/hyperledger/fabric-protos-go-apiv2/common"
11-
"github.com/hyperledger/fabric/msp"
1212
)
1313

1414
const (

platform/fabric/core/generic/membership/channelconfig/capabilities/channel_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ package capabilities
99
import (
1010
"testing"
1111

12+
"github.com/hyperledger-labs/fabric-smart-client/platform/fabric/msp"
1213
cb "github.com/hyperledger/fabric-protos-go-apiv2/common"
13-
"github.com/hyperledger/fabric/msp"
1414
"github.com/stretchr/testify/require"
1515
)
1616

platform/fabric/core/generic/membership/channelconfig/channel.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import (
1212

1313
"github.com/hyperledger-labs/fabric-smart-client/pkg/utils/errors"
1414
"github.com/hyperledger-labs/fabric-smart-client/platform/fabric/core/generic/membership/channelconfig/capabilities"
15+
"github.com/hyperledger-labs/fabric-smart-client/platform/fabric/msp"
1516
"github.com/hyperledger/fabric-lib-go/bccsp"
1617
cb "github.com/hyperledger/fabric-protos-go-apiv2/common"
17-
"github.com/hyperledger/fabric/msp"
1818
)
1919

2020
// Channel config keys

platform/fabric/core/generic/membership/channelconfig/msp.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ import (
1111

1212
"github.com/hyperledger-labs/fabric-smart-client/pkg/utils/errors"
1313
"github.com/hyperledger-labs/fabric-smart-client/pkg/utils/proto"
14+
"github.com/hyperledger-labs/fabric-smart-client/platform/fabric/msp"
15+
"github.com/hyperledger-labs/fabric-smart-client/platform/fabric/msp/cache"
1416
"github.com/hyperledger/fabric-lib-go/bccsp"
1517
mspprotos "github.com/hyperledger/fabric-protos-go-apiv2/msp"
16-
"github.com/hyperledger/fabric/msp"
17-
"github.com/hyperledger/fabric/msp/cache"
1818
)
1919

2020
type pendingMSPConfig struct {

platform/fabric/core/generic/membership/channelconfig/msp_test.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,18 @@ SPDX-License-Identifier: Apache-2.0
77
package channelconfig
88

99
import (
10+
"path/filepath"
1011
"testing"
1112

13+
"github.com/hyperledger-labs/fabric-smart-client/platform/fabric/msp"
1214
"github.com/hyperledger/fabric-lib-go/bccsp/factory"
1315
"github.com/hyperledger/fabric-lib-go/bccsp/sw"
1416
mspprotos "github.com/hyperledger/fabric-protos-go-apiv2/msp"
15-
"github.com/hyperledger/fabric/core/config/configtest"
16-
"github.com/hyperledger/fabric/msp"
1717
"github.com/stretchr/testify/require"
1818
)
1919

2020
func TestMSPConfigManager(t *testing.T) {
2121
mspDir := getDevMspDir()
22-
t.Logf("mspDir: %s", mspDir)
2322
conf, err := msp.GetLocalMspConfig(mspDir, nil, "SampleOrg")
2423
require.NoError(t, err)
2524

@@ -51,8 +50,12 @@ func TestMSPConfigManager(t *testing.T) {
5150
}
5251

5352
func getDevMspDir() string {
54-
// TODO replace once MSP import resolved
55-
return configtest.GetDevMspDir()
53+
// TODO can we do this somehow better?
54+
mspDir, err := filepath.Abs("../../../../msp/testdata/sampleconfig")
55+
if err != nil {
56+
panic(err)
57+
}
58+
return mspDir
5659
}
5760

5861
func TestMSPConfigFailure(t *testing.T) {

0 commit comments

Comments
 (0)