GetID to return clientId in base64 form (#771)

Signed-off-by: Krishnasuri Narayanam <knaraya3@in.ibm.com>
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
Co-authored-by: Arnaud J Le Hors <lehors@us.ibm.com>
This commit is contained in:
Krishnasuri Narayanam 2023-04-20 18:58:52 +05:30 committed by GitHub
parent 21361ae7b4
commit 2c831e4590
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,6 +9,7 @@ import (
"encoding/json"
"os"
"testing"
"encoding/base64"
"github.com/hyperledger/fabric-chaincode-go/pkg/cid"
"github.com/hyperledger/fabric-chaincode-go/shim"
@ -368,7 +369,7 @@ func prepMocks(orgMSP, clientId string) (*mocks.TransactionContext, *mocks.Chain
clientIdentity := &mocks.ClientIdentity{}
clientIdentity.GetMSPIDReturns(orgMSP, nil)
clientIdentity.GetIDReturns(clientId, nil)
clientIdentity.GetIDReturns(base64.StdEncoding.EncodeToString([]byte(clientId)), nil)
// set matching msp ID using peer shim env variable
os.Setenv("CORE_PEER_LOCALMSPID", orgMSP)
transactionContext.GetClientIdentityReturns(clientIdentity)