Skip to content

Commit

Permalink
Removing fabric/core/crypto/crypto.go
Browse files Browse the repository at this point in the history
This change-set finishes the cleanup of the interfaces
in crypto.go. All the references have been removed.

Change-Id: I5f30fc9f6adf3390a6951ccbcdfbf54edce0e379
Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
  • Loading branch information
adecaro committed Dec 7, 2016
1 parent 71805c9 commit 7bb0c52
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 1,979 deletions.
61 changes: 0 additions & 61 deletions core/crypto/crypto.go

This file was deleted.

38 changes: 0 additions & 38 deletions core/peer/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package peer

import (
"fmt"
"net"

"google.golang.org/grpc"
Expand All @@ -26,7 +25,6 @@ import (
"github.com/spf13/viper"

"github.com/hyperledger/fabric/core/comm"
"github.com/hyperledger/fabric/core/crypto"
pb "github.com/hyperledger/fabric/protos/peer"
)

Expand Down Expand Up @@ -66,39 +64,3 @@ func NewPeerClientConnectionWithAddress(peerAddress string) (*grpc.ClientConn, e
}
return comm.NewClientConnectionWithAddress(peerAddress, true, false, nil)
}

// Impl implements peer
type Impl struct {
secHelper crypto.Peer
}

// NewPeer returns a Peer implementation
func NewPeer(secHelperFunc func() crypto.Peer) (*Impl, error) {
peer := new(Impl)

peer.secHelper = secHelperFunc()

// Install security object for peer
if SecurityEnabled() {
if peer.secHelper == nil {
return nil, fmt.Errorf("Security helper not provided")
}
}

return peer, nil
}

// GetPeerEndpoint returns the endpoint for this peer
func (p *Impl) GetPeerEndpoint() (*pb.PeerEndpoint, error) {
ep, err := GetPeerEndpoint()
if err == nil && SecurityEnabled() {
// Set the PkiID on the PeerEndpoint if security is enabled
ep.PkiID = p.GetSecHelper().GetID()
}
return ep, err
}

// GetSecHelper returns the crypto.Peer
func (p *Impl) GetSecHelper() crypto.Peer {
return p.secHelper
}

0 comments on commit 7bb0c52

Please sign in to comment.