Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
fix serialize (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitiko authored Nov 6, 2019
1 parent 3e53d89 commit 7b04095
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions identity/cert_identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ package identity

import (
"crypto/x509"
"encoding/json"
"encoding/pem"
"time"

"github.com/hyperledger/fabric/msp"

"github.com/gogo/protobuf/proto"
"github.com/hyperledger/fabric/core/chaincode/lib/cid"
"github.com/hyperledger/fabric/core/chaincode/shim"
"github.com/hyperledger/fabric/msp"
protomsp "github.com/hyperledger/fabric/protos/msp"
"github.com/pkg/errors"
)
Expand Down Expand Up @@ -128,7 +127,7 @@ func (ci CertIdentity) Serialize() ([]byte, error) {

// ToBytes converts to serializedIdentity and then to json
func (ci CertIdentity) ToBytes() ([]byte, error) {
return json.Marshal(ci.ToSerialized())
return proto.Marshal(ci.ToSerialized())
}

func (ci CertIdentity) SatisfiesPrincipal(principal *protomsp.MSPPrincipal) error {
Expand Down

0 comments on commit 7b04095

Please sign in to comment.