Skip to content

Commit

Permalink
msp/mgmt: remove LoadLocalMspWithType
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Sykes <[email protected]>
  • Loading branch information
sykesm authored and Jason Yellick committed Mar 15, 2021
1 parent 8e3751a commit 50406fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
6 changes: 5 additions & 1 deletion internal/peer/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,11 @@ func InitCrypto(mspMgrConfigDir, localMSPID, localMSPType string) error {
return errors.WithMessage(err, "could not decode peer BCCSP configuration")
}

err = mspmgmt.LoadLocalMspWithType(mspMgrConfigDir, bccspConfig, localMSPID, localMSPType)
conf, err := msp.GetLocalMspConfigWithType(mspMgrConfigDir, bccspConfig, localMSPID, localMSPType)
if err != nil {
return err
}
err = mspmgmt.GetLocalMSP(factory.GetDefault()).Setup(conf)
if err != nil {
return errors.WithMessagef(err, "error when setting up MSP of type %s from directory %s", localMSPType, mspMgrConfigDir)
}
Expand Down
14 changes: 0 additions & 14 deletions msp/mgmt/mgmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,6 @@ import (
"github.com/spf13/viper"
)

// LoadLocalMspWithType loads the local MSP with the specified type from the specified directory
func LoadLocalMspWithType(dir string, bccspConfig *factory.FactoryOpts, mspID, mspType string) error {
if mspID == "" {
return errors.New("the local MSP must have an ID")
}

conf, err := msp.GetLocalMspConfigWithType(dir, bccspConfig, mspID, mspType)
if err != nil {
return err
}

return GetLocalMSP(factory.GetDefault()).Setup(conf)
}

// LoadLocalMsp loads the local MSP from the specified directory
func LoadLocalMsp(dir string, bccspConfig *factory.FactoryOpts, mspID string) error {
if mspID == "" {
Expand Down

0 comments on commit 50406fe

Please sign in to comment.