From c8a241b881583a4771f7765bffbe70a2e2b06096 Mon Sep 17 00:00:00 2001 From: Alessandro Sorniotti Date: Thu, 21 Dec 2017 21:51:34 +0100 Subject: [PATCH] [FAB-7497] fix typos in previous commit Change-Id: Ia02725c2eb5d4c99dbd7a5da2fc2dcfe6782cfca Signed-off-by: Alessandro Sorniotti --- core/chaincode/handler.go | 4 ++-- core/common/ccprovider/ccprovider.go | 2 +- core/endorser/endorser.go | 6 +++--- core/endorser/endorser_test.go | 14 +++++++------- core/endorser/support.go | 6 +++--- core/mocks/endorser/support.go | 6 +++--- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/core/chaincode/handler.go b/core/chaincode/handler.go index 0e76c870176..a9204c671eb 100644 --- a/core/chaincode/handler.go +++ b/core/chaincode/handler.go @@ -1327,9 +1327,9 @@ func (handler *Handler) enterBusyState(e *fsm.Event, state string) { version = cd.CCVersion() - err = ccprovider.CheckInsantiationPolicy(calledCcIns.ChaincodeName, version, cd.(*ccprovider.ChaincodeData)) + err = ccprovider.CheckInstantiationPolicy(calledCcIns.ChaincodeName, version, cd.(*ccprovider.ChaincodeData)) if err != nil { - errHandler([]byte(err.Error()), "[%s]CheckInsantiationPolicy, error %s. Sending %s", shorttxid(msg.Txid), err, pb.ChaincodeMessage_ERROR) + errHandler([]byte(err.Error()), "[%s]CheckInstantiationPolicy, error %s. Sending %s", shorttxid(msg.Txid), err, pb.ChaincodeMessage_ERROR) return } } else { diff --git a/core/common/ccprovider/ccprovider.go b/core/common/ccprovider/ccprovider.go index e38deb63375..555a501b0bd 100644 --- a/core/common/ccprovider/ccprovider.go +++ b/core/common/ccprovider/ccprovider.go @@ -213,7 +213,7 @@ func GetChaincodeData(ccname string, ccversion string) (*ChaincodeData, error) { } } -func CheckInsantiationPolicy(name, version string, cdLedger *ChaincodeData) error { +func CheckInstantiationPolicy(name, version string, cdLedger *ChaincodeData) error { ccdata, err := GetChaincodeData(name, version) if err != nil { return err diff --git a/core/endorser/endorser.go b/core/endorser/endorser.go index ab681b1cf4c..eb04702732e 100644 --- a/core/endorser/endorser.go +++ b/core/endorser/endorser.go @@ -81,9 +81,9 @@ type Support interface { // that requires the java runtime environment to execute IsJavaCC(buf []byte) (bool, error) - // CheckInsantiationPolicy returns an error if the instantiation in the supplied + // CheckInstantiationPolicy returns an error if the instantiation in the supplied // ChaincodeDefinition differs from the instantiation policy stored on the ledger - CheckInsantiationPolicy(name, version string, cd resourcesconfig.ChaincodeDefinition) error + CheckInstantiationPolicy(name, version string, cd resourcesconfig.ChaincodeDefinition) error // GetApplicationConfig returns the configtxapplication.SharedConfig for the channel // and whether the Application config exists @@ -240,7 +240,7 @@ func (e *Endorser) simulateProposal(ctx context.Context, chainID string, txid st } version = cdLedger.CCVersion() - err = e.s.CheckInsantiationPolicy(cid.Name, version, cdLedger) + err = e.s.CheckInstantiationPolicy(cid.Name, version, cdLedger) if err != nil { return nil, nil, nil, nil, err } diff --git a/core/endorser/endorser_test.go b/core/endorser/endorser_test.go index 0a443910ca2..aebfe2e82ae 100644 --- a/core/endorser/endorser_test.go +++ b/core/endorser/endorser_test.go @@ -127,13 +127,13 @@ func TestEndorserBadInstPolicy(t *testing.T) { es := NewEndorserServer(func(channel string, txID string, privateData *rwset.TxPvtReadWriteSet) error { return nil }, &em.MockSupport{ - GetApplicationConfigBoolRv: true, - GetApplicationConfigRv: &mc.MockApplication{&mc.MockApplicationCapabilities{}}, - GetTransactionByIDErr: errors.New(""), - CheckInsantiationPolicyError: errors.New(""), - ChaincodeDefinitionRv: &resourceconfig.MockChaincodeDefinition{EndorsementStr: "ESCC"}, - ExecuteResp: &pb.Response{Status: 200, Payload: utils.MarshalOrPanic(&pb.ProposalResponse{Response: &pb.Response{}})}, - GetTxSimulatorRv: &ccprovider.MockTxSim{&ledger.TxSimulationResults{PubSimulationResults: &rwset.TxReadWriteSet{}}}, + GetApplicationConfigBoolRv: true, + GetApplicationConfigRv: &mc.MockApplication{&mc.MockApplicationCapabilities{}}, + GetTransactionByIDErr: errors.New(""), + CheckInstantiationPolicyError: errors.New(""), + ChaincodeDefinitionRv: &resourceconfig.MockChaincodeDefinition{EndorsementStr: "ESCC"}, + ExecuteResp: &pb.Response{Status: 200, Payload: utils.MarshalOrPanic(&pb.ProposalResponse{Response: &pb.Response{}})}, + GetTxSimulatorRv: &ccprovider.MockTxSim{&ledger.TxSimulationResults{PubSimulationResults: &rwset.TxReadWriteSet{}}}, }) signedProp := getSignedProp("ccid", "0", t) diff --git a/core/endorser/support.go b/core/endorser/support.go index d20c3e00d33..ae01f02e044 100644 --- a/core/endorser/support.go +++ b/core/endorser/support.go @@ -123,10 +123,10 @@ func (s *SupportImpl) IsJavaCC(buf []byte) (bool, error) { return (cds.ChaincodeSpec.Type == pb.ChaincodeSpec_JAVA), nil } -// CheckInsantiationPolicy returns an error if the instantiation in the supplied +// CheckInstantiationPolicy returns an error if the instantiation in the supplied // ChaincodeDefinition differs from the instantiation policy stored on the ledger -func (s *SupportImpl) CheckInsantiationPolicy(name, version string, cd resourcesconfig.ChaincodeDefinition) error { - return ccprovider.CheckInsantiationPolicy(name, version, cd.(*ccprovider.ChaincodeData)) +func (s *SupportImpl) CheckInstantiationPolicy(name, version string, cd resourcesconfig.ChaincodeDefinition) error { + return ccprovider.CheckInstantiationPolicy(name, version, cd.(*ccprovider.ChaincodeData)) } // GetApplicationConfig returns the configtxapplication.SharedConfig for the channel diff --git a/core/mocks/endorser/support.go b/core/mocks/endorser/support.go index 4c7a23d7840..bd7f3f43903 100644 --- a/core/mocks/endorser/support.go +++ b/core/mocks/endorser/support.go @@ -29,7 +29,7 @@ type MockSupport struct { ChaincodeDefinitionError error GetTxSimulatorRv *mc.MockTxSim GetTxSimulatorErr error - CheckInsantiationPolicyError error + CheckInstantiationPolicyError error GetTransactionByIDErr error CheckACLErr error SysCCMap map[string]struct{} @@ -85,8 +85,8 @@ func (s *MockSupport) IsJavaCC(buf []byte) (bool, error) { return s.IsJavaRV, s.IsJavaErr } -func (s *MockSupport) CheckInsantiationPolicy(name, version string, cd resourcesconfig.ChaincodeDefinition) error { - return s.CheckInsantiationPolicyError +func (s *MockSupport) CheckInstantiationPolicy(name, version string, cd resourcesconfig.ChaincodeDefinition) error { + return s.CheckInstantiationPolicyError } func (s *MockSupport) GetApplicationConfig(cid string) (channelconfig.Application, bool) {