代码拉取完成,页面将自动刷新
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package lscc
import (
"github.com/hyperledger/fabric/core/common/ccprovider"
"github.com/hyperledger/fabric/protos/peer"
)
type MockSupport struct {
PutChaincodeToLocalStorageErr error
GetChaincodeFromLocalStorageRv ccprovider.CCPackage
GetChaincodeFromLocalStorageErr error
GetChaincodesFromLocalStorageRv *peer.ChaincodeQueryResponse
GetChaincodesFromLocalStorageErr error
GetInstantiationPolicyRv []byte
GetInstantiationPolicyErr error
CheckInstantiationPolicyErr error
GetInstantiationPolicyMap map[string][]byte
CheckInstantiationPolicyMap map[string]error
}
func (s *MockSupport) PutChaincodeToLocalStorage(ccpack ccprovider.CCPackage) error {
return s.PutChaincodeToLocalStorageErr
}
func (s *MockSupport) GetChaincodeFromLocalStorage(ccname string, ccversion string) (ccprovider.CCPackage, error) {
return s.GetChaincodeFromLocalStorageRv, s.GetChaincodeFromLocalStorageErr
}
func (s *MockSupport) GetChaincodesFromLocalStorage() (*peer.ChaincodeQueryResponse, error) {
return s.GetChaincodesFromLocalStorageRv, s.GetChaincodesFromLocalStorageErr
}
func (s *MockSupport) GetInstantiationPolicy(channel string, ccpack ccprovider.CCPackage) ([]byte, error) {
if s.GetInstantiationPolicyMap != nil {
str := ccpack.GetChaincodeData().Name + ccpack.GetChaincodeData().Version
s.GetInstantiationPolicyMap[str] = []byte(str)
return []byte(ccpack.GetChaincodeData().Name + ccpack.GetChaincodeData().Version), nil
}
return s.GetInstantiationPolicyRv, s.GetInstantiationPolicyErr
}
func (s *MockSupport) CheckInstantiationPolicy(signedProp *peer.SignedProposal, chainName string, instantiationPolicy []byte) error {
if s.CheckInstantiationPolicyMap != nil {
return s.CheckInstantiationPolicyMap[string(instantiationPolicy)]
}
return s.CheckInstantiationPolicyErr
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。