From 7b040955be36849f506a99ce7a45d97b5ee85431 Mon Sep 17 00:00:00 2001 From: Victor Nosov Date: Wed, 6 Nov 2019 16:08:03 +0300 Subject: [PATCH] fix serialize (#30) --- identity/cert_identity.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/identity/cert_identity.go b/identity/cert_identity.go index 1974de45..f3912000 100644 --- a/identity/cert_identity.go +++ b/identity/cert_identity.go @@ -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" ) @@ -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 {