Skip to content

Commit

Permalink
[FAB-7497] fix typos in previous commit
Browse files Browse the repository at this point in the history
Change-Id: Ia02725c2eb5d4c99dbd7a5da2fc2dcfe6782cfca
Signed-off-by: Alessandro Sorniotti <ale.linux@sopit.net>
  • Loading branch information
ale-linux committed Dec 21, 2017
1 parent 8a705b7 commit c8a241b
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions core/chaincode/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion core/common/ccprovider/ccprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions core/endorser/endorser.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down
14 changes: 7 additions & 7 deletions core/endorser/endorser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions core/endorser/support.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions core/mocks/endorser/support.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit c8a241b

Please sign in to comment.