Skip to content

Commit a24ff9b

Browse files
committed
crypto和默认命名保持一致
1 parent 5cbeca5 commit a24ff9b

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

kernel/contract/sandbox/cross_query_cache.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,22 @@ func isEndorsorSignValid(signsValid []*pb.SignatureInfo, queryInfo *pb.CrossQuer
248248
//log.Info("Marshal Response failed", "err", err)
249249
return false
250250
}
251+
<<<<<<< HEAD
251252
cryptoClient, err := crypto_client.CreateCryptoClient(crypto_client.CryptoTypeDefault)
253+
=======
254+
255+
//bug(springrain) 需要定义一个参数,用于标示目标链的的加密方式,默认非国密
256+
cryptoType := crypto_client.CryptoTypeDefault
257+
argsMap := queryInfo.GetRequest().Request.GetArgs()
258+
if argsMap != nil {
259+
if crypto, ok := argsMap["crypto"]; ok {
260+
if string(crypto) == "gm" {
261+
cryptoType = "gm"
262+
}
263+
}
264+
}
265+
cryptoClient, err := crypto_client.CreateCryptoClient(cryptoType)
266+
>>>>>>> d35f343 (crypto和默认命名保持一致)
252267
data := append(reqData[:], resData[:]...)
253268
digest := hash.UsingSha256(data)
254269
for idx := range signsValid {

0 commit comments

Comments
 (0)