Skip to content

Commit

Permalink
[FAB-9238] refactoring configs to multiple interfaces
Browse files Browse the repository at this point in the history
- Config is broken down to core.CryptoSuiteConfig,
fab.EndpointConfig and msp.IdentityConfig interfaces
- Core.ConfigBackend acts as a common backend to all
config types
- fabsdk.New() to accept ConfigBackend to create new SDK instances
- fabsdk.New() to accept any of the config interfaces as an option
- fabsdk.Config() to return config provider function which returns
all 3 kinds of configs
- Refactored all packages to use either of these 3 config types
instead of whole config
- Moved static utilities out of pkg/core/config to relavant packages

Change-Id: If030ab2ced208da8dba66ed26c984107316ac5d9
Signed-off-by: Sudesh Shetty <[email protected]>
  • Loading branch information
sudeshrshetty committed Mar 29, 2018
1 parent 2c86c85 commit 6420348
Show file tree
Hide file tree
Showing 133 changed files with 3,890 additions and 3,401 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,9 @@ dockerenv-latest-up: clean

.PHONY: mock-gen
mock-gen:
mockgen -build_flags '$(GO_LDFLAGS_ARG)' -package mockcore github.com/hyperledger/fabric-sdk-go/pkg/common/providers/core Config,Providers | sed "s/github.com\/hyperledger\/fabric-sdk-go\/vendor\///g" | goimports > pkg/common/providers/test/mockcore/mockcore.gen.go
mockgen -build_flags '$(GO_LDFLAGS_ARG)' -package mockmsp github.com/hyperledger/fabric-sdk-go/pkg/common/providers/msp IdentityManager,Providers | sed "s/github.com\/hyperledger\/fabric-sdk-go\/vendor\///g" | goimports > pkg/common/providers/test/mockmsp/mockmsp.gen.go
mockgen -build_flags '$(GO_LDFLAGS_ARG)' -package mockfab github.com/hyperledger/fabric-sdk-go/pkg/common/providers/fab ProposalProcessor,Providers | sed "s/github.com\/hyperledger\/fabric-sdk-go\/vendor\///g" | goimports > pkg/common/providers/test/mockfab/mockfab.gen.go
mockgen -build_flags '$(GO_LDFLAGS_ARG)' -package mockcore github.com/hyperledger/fabric-sdk-go/pkg/common/providers/core CryptoSuiteConfig,ConfigBackend,Providers | sed "s/github.com\/hyperledger\/fabric-sdk-go\/vendor\///g" | goimports > pkg/common/providers/test/mockcore/mockcore.gen.go
mockgen -build_flags '$(GO_LDFLAGS_ARG)' -package mockmsp github.com/hyperledger/fabric-sdk-go/pkg/common/providers/msp IdentityConfig,IdentityManager,Providers | sed "s/github.com\/hyperledger\/fabric-sdk-go\/vendor\///g" | goimports > pkg/common/providers/test/mockmsp/mockmsp.gen.go
mockgen -build_flags '$(GO_LDFLAGS_ARG)' -package mockfab github.com/hyperledger/fabric-sdk-go/pkg/common/providers/fab EndpointConfig,ProposalProcessor,Providers | sed "s/github.com\/hyperledger\/fabric-sdk-go\/vendor\///g" | goimports > pkg/common/providers/test/mockfab/mockfab.gen.go
mockgen -build_flags '$(GO_LDFLAGS_ARG)' -package mockcontext github.com/hyperledger/fabric-sdk-go/pkg/common/providers/context Providers,Client | sed "s/github.com\/hyperledger\/fabric-sdk-go\/vendor\///g" | goimports > pkg/common/providers/test/mockcontext/mockcontext.gen.go
mockgen -build_flags '$(GO_LDFLAGS_ARG)' -package mocksdkapi github.com/hyperledger/fabric-sdk-go/pkg/fabsdk/api CoreProviderFactory,MSPProviderFactory,ServiceProviderFactory | sed "s/github.com\/hyperledger\/fabric-sdk-go\/vendor\///g" | goimports > pkg/fabsdk/test/mocksdkapi/mocksdkapi.gen.go
mockgen -build_flags '$(GO_LDFLAGS_ARG)' -package mockmspapi github.com/hyperledger/fabric-sdk-go/pkg/msp/api CAClient | sed "s/github.com\/hyperledger\/fabric-sdk-go\/vendor\///g" | goimports > pkg/msp/test/mockmspapi/mockmspapi.gen.go
Expand Down
13 changes: 6 additions & 7 deletions pkg/client/channel/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ import (

"github.com/hyperledger/fabric-sdk-go/pkg/common/errors/retry"
"github.com/hyperledger/fabric-sdk-go/pkg/common/providers/context"
"github.com/hyperledger/fabric-sdk-go/pkg/common/providers/core"
"github.com/hyperledger/fabric-sdk-go/pkg/common/providers/fab"
"github.com/hyperledger/fabric-sdk-go/pkg/core/config"
"github.com/hyperledger/fabric-sdk-go/pkg/fab/comm"
pb "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/peer"
"github.com/pkg/errors"
)
Expand All @@ -24,8 +23,8 @@ type requestOptions struct {
Targets []fab.Peer // targets
TargetFilter fab.TargetFilter
Retry retry.Opts
Timeouts map[core.TimeoutType]time.Duration //timeout options for channel client operations
ParentContext reqContext.Context //parent grpc context for channel client operations (query, execute, invokehandler)
Timeouts map[fab.TimeoutType]time.Duration //timeout options for channel client operations
ParentContext reqContext.Context //parent grpc context for channel client operations (query, execute, invokehandler)
}

// RequestOption func for each Opts argument
Expand Down Expand Up @@ -68,7 +67,7 @@ func WithTargetURLs(urls ...string) RequestOption {

for _, url := range urls {

peerCfg, err := config.NetworkPeerConfigFromURL(ctx.Config(), url)
peerCfg, err := comm.NetworkPeerConfigFromURL(ctx.EndpointConfig(), url)
if err != nil {
return err
}
Expand Down Expand Up @@ -102,10 +101,10 @@ func WithRetry(retryOpt retry.Opts) RequestOption {
}

//WithTimeout encapsulates key value pairs of timeout type, timeout duration to Options
func WithTimeout(timeoutType core.TimeoutType, timeout time.Duration) RequestOption {
func WithTimeout(timeoutType fab.TimeoutType, timeout time.Duration) RequestOption {
return func(ctx context.Client, o *requestOptions) error {
if o.Timeouts == nil {
o.Timeouts = make(map[core.TimeoutType]time.Duration)
o.Timeouts = make(map[fab.TimeoutType]time.Duration)
}
o.Timeouts[timeoutType] = timeout
return nil
Expand Down
38 changes: 19 additions & 19 deletions pkg/client/channel/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

"time"

"github.com/hyperledger/fabric-sdk-go/pkg/common/providers/core"
"github.com/hyperledger/fabric-sdk-go/pkg/common/providers/fab"
fcmocks "github.com/hyperledger/fabric-sdk-go/pkg/fab/mocks"
mspmocks "github.com/hyperledger/fabric-sdk-go/pkg/msp/test/mockmsp"
"github.com/stretchr/testify/assert"
Expand All @@ -23,12 +23,12 @@ func TestWithTargetURLsInvalid(t *testing.T) {

mockConfig := &fcmocks.MockConfig{}

oConfig := &core.PeerConfig{
oConfig := &fab.PeerConfig{
URL: "127.0.0.1:7050",
}

mockConfig.SetCustomPeerCfg(oConfig)
ctx.SetConfig(mockConfig)
ctx.SetEndpointConfig(mockConfig)

opts := requestOptions{}
err := opt(ctx, &opts)
Expand All @@ -41,27 +41,27 @@ func TestWithTargetURLsValid(t *testing.T) {

mockConfig := &fcmocks.MockConfig{}

pConfig1 := core.PeerConfig{
pConfig1 := fab.PeerConfig{
URL: "127.0.0.1:7050",
}

npConfig1 := core.NetworkPeer{
npConfig1 := fab.NetworkPeer{
PeerConfig: pConfig1,
MSPID: "MYMSP",
}

pConfig2 := core.PeerConfig{
pConfig2 := fab.PeerConfig{
URL: "127.0.0.1:7051",
}

npConfig2 := core.NetworkPeer{
npConfig2 := fab.NetworkPeer{
PeerConfig: pConfig2,
MSPID: "OTHERMSP",
}

mockConfig.SetCustomPeerCfg(&pConfig1)
mockConfig.SetCustomNetworkPeerCfg([]core.NetworkPeer{npConfig2, npConfig1})
ctx.SetConfig(mockConfig)
mockConfig.SetCustomNetworkPeerCfg([]fab.NetworkPeer{npConfig2, npConfig1})
ctx.SetEndpointConfig(mockConfig)

opts := requestOptions{}
err := opt(ctx, &opts)
Expand All @@ -82,20 +82,20 @@ func TestTimeoutOptions(t *testing.T) {

opts := requestOptions{}

options := []RequestOption{WithTimeout(core.PeerResponse, 20*time.Second),
WithTimeout(core.ResMgmt, 25*time.Second), WithTimeout(core.OrdererResponse, 30*time.Second),
WithTimeout(core.EventHubConnection, 35*time.Second), WithTimeout(core.Execute, 40*time.Second),
WithTimeout(core.Query, 45*time.Second)}
options := []RequestOption{WithTimeout(fab.PeerResponse, 20*time.Second),
WithTimeout(fab.ResMgmt, 25*time.Second), WithTimeout(fab.OrdererResponse, 30*time.Second),
WithTimeout(fab.EventHubConnection, 35*time.Second), WithTimeout(fab.Execute, 40*time.Second),
WithTimeout(fab.Query, 45*time.Second)}

for _, option := range options {
option(nil, &opts)
}

assert.True(t, opts.Timeouts[core.PeerResponse] == 20*time.Second, "timeout value by type didn't match with one supplied")
assert.True(t, opts.Timeouts[core.ResMgmt] == 25*time.Second, "timeout value by type didn't match with one supplied")
assert.True(t, opts.Timeouts[core.OrdererResponse] == 30*time.Second, "timeout value by type didn't match with one supplied")
assert.True(t, opts.Timeouts[core.EventHubConnection] == 35*time.Second, "timeout value by type didn't match with one supplied")
assert.True(t, opts.Timeouts[core.Execute] == 40*time.Second, "timeout value by type didn't match with one supplied")
assert.True(t, opts.Timeouts[core.Query] == 45*time.Second, "timeout value by type didn't match with one supplied")
assert.True(t, opts.Timeouts[fab.PeerResponse] == 20*time.Second, "timeout value by type didn't match with one supplied")
assert.True(t, opts.Timeouts[fab.ResMgmt] == 25*time.Second, "timeout value by type didn't match with one supplied")
assert.True(t, opts.Timeouts[fab.OrdererResponse] == 30*time.Second, "timeout value by type didn't match with one supplied")
assert.True(t, opts.Timeouts[fab.EventHubConnection] == 35*time.Second, "timeout value by type didn't match with one supplied")
assert.True(t, opts.Timeouts[fab.Execute] == 40*time.Second, "timeout value by type didn't match with one supplied")
assert.True(t, opts.Timeouts[fab.Query] == 45*time.Second, "timeout value by type didn't match with one supplied")

}
19 changes: 9 additions & 10 deletions pkg/client/channel/chclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"github.com/hyperledger/fabric-sdk-go/pkg/common/errors/status"
"github.com/hyperledger/fabric-sdk-go/pkg/common/logging"
"github.com/hyperledger/fabric-sdk-go/pkg/common/providers/context"
"github.com/hyperledger/fabric-sdk-go/pkg/common/providers/core"
"github.com/hyperledger/fabric-sdk-go/pkg/common/providers/fab"
contextImpl "github.com/hyperledger/fabric-sdk-go/pkg/context"
"github.com/pkg/errors"
Expand Down Expand Up @@ -48,7 +47,7 @@ func New(channelProvider context.ChannelProvider, opts ...ClientOption) (*Client
return nil, errors.WithMessage(err, "failed to create channel context")
}

greylistProvider := greylist.New(channelContext.Config().TimeoutOrDefault(core.DiscoveryGreylistExpiry))
greylistProvider := greylist.New(channelContext.EndpointConfig().TimeoutOrDefault(fab.DiscoveryGreylistExpiry))

if channelContext.ChannelService() == nil {
return nil, errors.New("channel service not initialized")
Expand Down Expand Up @@ -83,7 +82,7 @@ func New(channelProvider context.ChannelProvider, opts ...ClientOption) (*Client

// Query chaincode using request and optional options provided
func (cc *Client) Query(request Request, options ...RequestOption) (Response, error) {
optsWithTimeout, err := cc.addDefaultTimeout(cc.context, core.Query, options...)
optsWithTimeout, err := cc.addDefaultTimeout(cc.context, fab.Query, options...)
if err != nil {
return Response{}, errors.WithMessage(err, "option failed")
}
Expand All @@ -93,7 +92,7 @@ func (cc *Client) Query(request Request, options ...RequestOption) (Response, er

// Execute prepares and executes transaction using request and optional options provided
func (cc *Client) Execute(request Request, options ...RequestOption) (Response, error) {
optsWithTimeout, err := cc.addDefaultTimeout(cc.context, core.Execute, options...)
optsWithTimeout, err := cc.addDefaultTimeout(cc.context, fab.Execute, options...)
if err != nil {
return Response{}, errors.WithMessage(err, "option failed")
}
Expand Down Expand Up @@ -154,15 +153,15 @@ func (cc *Client) InvokeHandler(handler invoke.Handler, request Request, options
func (cc *Client) createReqContext(txnOpts *requestOptions) (reqContext.Context, reqContext.CancelFunc) {

if txnOpts.Timeouts == nil {
txnOpts.Timeouts = make(map[core.TimeoutType]time.Duration)
txnOpts.Timeouts = make(map[fab.TimeoutType]time.Duration)
}

//setting default timeouts when not provided
if txnOpts.Timeouts[core.Execute] == 0 {
txnOpts.Timeouts[core.Execute] = cc.context.Config().TimeoutOrDefault(core.Execute)
if txnOpts.Timeouts[fab.Execute] == 0 {
txnOpts.Timeouts[fab.Execute] = cc.context.EndpointConfig().TimeoutOrDefault(fab.Execute)
}

reqCtx, cancel := contextImpl.NewRequest(cc.context, contextImpl.WithTimeout(txnOpts.Timeouts[core.Execute]),
reqCtx, cancel := contextImpl.NewRequest(cc.context, contextImpl.WithTimeout(txnOpts.Timeouts[fab.Execute]),
contextImpl.WithParent(txnOpts.ParentContext))
//Add timeout overrides here as a value so that it can be used by immediate child contexts (in handlers/transactors)
reqCtx = reqContext.WithValue(reqCtx, contextImpl.ReqContextTimeoutOverrides, txnOpts.Timeouts)
Expand Down Expand Up @@ -229,7 +228,7 @@ func (cc *Client) prepareOptsFromOptions(ctx context.Client, options ...RequestO
}

//addDefaultTimeout adds given default timeout if it is missing in options
func (cc *Client) addDefaultTimeout(ctx context.Client, timeOutType core.TimeoutType, options ...RequestOption) ([]RequestOption, error) {
func (cc *Client) addDefaultTimeout(ctx context.Client, timeOutType fab.TimeoutType, options ...RequestOption) ([]RequestOption, error) {
txnOpts := requestOptions{}
for _, option := range options {
err := option(ctx, &txnOpts)
Expand All @@ -240,7 +239,7 @@ func (cc *Client) addDefaultTimeout(ctx context.Client, timeOutType core.Timeout

if txnOpts.Timeouts[timeOutType] == 0 {
//InvokeHandler relies on Execute timeout
return append(options, WithTimeout(core.Execute, cc.context.Config().TimeoutOrDefault(timeOutType))), nil
return append(options, WithTimeout(fab.Execute, cc.context.EndpointConfig().TimeoutOrDefault(timeOutType))), nil
}
return options, nil
}
Expand Down
5 changes: 2 additions & 3 deletions pkg/client/channel/chclient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"github.com/hyperledger/fabric-sdk-go/pkg/common/errors/retry"
"github.com/hyperledger/fabric-sdk-go/pkg/common/errors/status"
"github.com/hyperledger/fabric-sdk-go/pkg/common/providers/context"
"github.com/hyperledger/fabric-sdk-go/pkg/common/providers/core"
"github.com/hyperledger/fabric-sdk-go/pkg/common/providers/fab"
contextImpl "github.com/hyperledger/fabric-sdk-go/pkg/context"
fcmocks "github.com/hyperledger/fabric-sdk-go/pkg/fab/mocks"
Expand Down Expand Up @@ -435,7 +434,7 @@ func TestDiscoveryGreylist(t *testing.T) {
testPeer1.Error = status.New(status.EndorserClientStatus,
status.ConnectionFailed.ToInt32(), "test", []interface{}{testPeer1.URL()})

selectionProvider, err := staticselection.New(fcmocks.NewMockConfig())
selectionProvider, err := staticselection.New(fcmocks.NewMockEndpointConfig())
assert.Nil(t, err, "Got error %s", err)

selectionService, err := selectionProvider.CreateSelectionService("mychannel")
Expand Down Expand Up @@ -470,7 +469,7 @@ func TestDiscoveryGreylist(t *testing.T) {
assert.EqualValues(t, status.NoPeersFound.ToInt32(), s.Code, "expected No Peers Found status on greylist")
assert.Equal(t, 1, testPeer1.ProcessProposalCalls, "expected peer 1 to be greylisted")
// Wait for greylist expiry
time.Sleep(chClient.context.Config().TimeoutOrDefault(core.DiscoveryGreylistExpiry))
time.Sleep(chClient.context.EndpointConfig().TimeoutOrDefault(fab.DiscoveryGreylistExpiry))
testPeer1.ProcessProposalCalls = 0
testPeer1.Error = status.New(status.EndorserServerStatus, int32(common.Status_SERVICE_UNAVAILABLE), "test", nil)
// Try again
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/channel/invoke/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type Opts struct {
Targets []fab.Peer // targets
TargetFilter fab.TargetFilter
Retry retry.Opts
Timeouts map[core.TimeoutType]time.Duration
Timeouts map[fab.TimeoutType]time.Duration
ParentContext reqContext.Context //parent grpc context
}

Expand Down
7 changes: 3 additions & 4 deletions pkg/client/channel/invoke/txnhandler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
txnmocks "github.com/hyperledger/fabric-sdk-go/pkg/client/common/mocks"
"github.com/hyperledger/fabric-sdk-go/pkg/common/errors/status"
"github.com/hyperledger/fabric-sdk-go/pkg/common/providers/context"
"github.com/hyperledger/fabric-sdk-go/pkg/common/providers/core"
"github.com/hyperledger/fabric-sdk-go/pkg/common/providers/fab"
fcmocks "github.com/hyperledger/fabric-sdk-go/pkg/fab/mocks"
mspmocks "github.com/hyperledger/fabric-sdk-go/pkg/msp/test/mockmsp"
Expand Down Expand Up @@ -75,7 +74,7 @@ func TestExecuteTxHandlerSuccess(t *testing.T) {
select {
case txStatusReg := <-mockEventService.TxStatusRegCh:
txStatusReg.Eventch <- &fab.TxStatusEvent{TxID: txStatusReg.TxID, TxValidationCode: pb.TxValidationCode_VALID}
case <-time.After(requestContext.Opts.Timeouts[core.Execute]):
case <-time.After(requestContext.Opts.Timeouts[fab.Execute]):
panic("Execute handler : time out not expected")
}
}()
Expand Down Expand Up @@ -252,8 +251,8 @@ func prepareRequestContext(request Request, opts Opts, t *testing.T) *RequestCon
Ctx: reqContext.Background(),
}

requestContext.Opts.Timeouts = make(map[core.TimeoutType]time.Duration)
requestContext.Opts.Timeouts[core.Execute] = testTimeOut
requestContext.Opts.Timeouts = make(map[fab.TimeoutType]time.Duration)
requestContext.Opts.Timeouts[fab.Execute] = testTimeOut
if opts.TargetFilter != nil {
requestContext.SelectionFilter = func(peer fab.Peer) bool {
return opts.TargetFilter.Accept(peer)
Expand Down
12 changes: 8 additions & 4 deletions pkg/client/common/discovery/discoveryfilter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"testing"

"github.com/hyperledger/fabric-sdk-go/pkg/client/common/discovery/staticdiscovery"
"github.com/hyperledger/fabric-sdk-go/pkg/common/providers/core"
"github.com/hyperledger/fabric-sdk-go/pkg/common/providers/fab"
"github.com/hyperledger/fabric-sdk-go/pkg/core/config"
"github.com/hyperledger/fabric-sdk-go/pkg/fab/peer"
Expand All @@ -28,7 +27,12 @@ func (df *mockFilter) Accept(peer fab.Peer) bool {

func TestDiscoveryFilter(t *testing.T) {

config, err := config.FromFile("../../../../test/fixtures/config/config_test.yaml")()
configBackend, err := config.FromFile("../../../../test/fixtures/config/config_test.yaml")()
if err != nil {
t.Fatalf(err.Error())
}

_, config, _, err := config.FromBackend(configBackend)()
if err != nil {
t.Fatalf(err.Error())
}
Expand Down Expand Up @@ -66,9 +70,9 @@ func TestDiscoveryFilter(t *testing.T) {
}

type defPeerCreator struct {
config core.Config
config fab.EndpointConfig
}

func (pc *defPeerCreator) CreatePeerFromConfig(peerCfg *core.NetworkPeer) (fab.Peer, error) {
func (pc *defPeerCreator) CreatePeerFromConfig(peerCfg *fab.NetworkPeer) (fab.Peer, error) {
return peer.New(pc.config, peer.FromPeerConfig(peerCfg))
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ SPDX-License-Identifier: Apache-2.0
package staticdiscovery

import (
"github.com/hyperledger/fabric-sdk-go/pkg/common/providers/core"
"github.com/hyperledger/fabric-sdk-go/pkg/common/providers/fab"

"github.com/pkg/errors"
)

type peerCreator interface {
CreatePeerFromConfig(peerCfg *core.NetworkPeer) (fab.Peer, error)
CreatePeerFromConfig(peerCfg *fab.NetworkPeer) (fab.Peer, error)
}

/**
Expand All @@ -23,18 +22,18 @@ type peerCreator interface {

// DiscoveryProvider implements discovery provider
type DiscoveryProvider struct {
config core.Config
config fab.EndpointConfig
fabPvdr peerCreator
}

// discoveryService implements discovery service
type discoveryService struct {
config core.Config
config fab.EndpointConfig
peers []fab.Peer
}

// New returns discovery provider
func New(config core.Config, fabPvdr peerCreator) (*DiscoveryProvider, error) {
func New(config fab.EndpointConfig, fabPvdr peerCreator) (*DiscoveryProvider, error) {
return &DiscoveryProvider{config: config, fabPvdr: fabPvdr}, nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,19 @@ package staticdiscovery
import (
"testing"

"github.com/hyperledger/fabric-sdk-go/pkg/common/providers/core"
"github.com/hyperledger/fabric-sdk-go/pkg/common/providers/fab"
"github.com/hyperledger/fabric-sdk-go/pkg/core/config"
"github.com/hyperledger/fabric-sdk-go/pkg/fab/peer"
)

func TestStaticDiscovery(t *testing.T) {

config, err := config.FromFile("../../../../../test/fixtures/config/config_test.yaml")()
configBackend, err := config.FromFile("../../../../../test/fixtures/config/config_test.yaml")()
if err != nil {
t.Fatalf(err.Error())
}

_, config, _, err := config.FromBackend(configBackend)()
if err != nil {
t.Fatalf(err.Error())
}
Expand Down Expand Up @@ -69,9 +73,9 @@ func TestStaticDiscovery(t *testing.T) {
}

type defPeerCreator struct {
config core.Config
config fab.EndpointConfig
}

func (pc *defPeerCreator) CreatePeerFromConfig(peerCfg *core.NetworkPeer) (fab.Peer, error) {
func (pc *defPeerCreator) CreatePeerFromConfig(peerCfg *fab.NetworkPeer) (fab.Peer, error) {
return peer.New(pc.config, peer.FromPeerConfig(peerCfg))
}
Loading

0 comments on commit 6420348

Please sign in to comment.