Skip to content

Commit d72773e

Browse files
author
Jason Yellick
committed
FAB-11031 Remove 'Syscc' from CCContext
The syscc attribute is only used as part of deciding whether or not to print a log message. And, it is unnecessary in this case, so, removing it. Change-Id: I17ff4f654984240deddb726cc5902f83232993c3 Signed-off-by: Jason Yellick <jyellick@us.ibm.com>
1 parent e67a85f commit d72773e

File tree

13 files changed

+68
-78
lines changed

13 files changed

+68
-78
lines changed

core/chaincode/chaincode_support.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,17 +132,17 @@ func (cs *ChaincodeSupport) Launch(cccid *ccprovider.CCContext, spec *pb.Chainco
132132
return nil
133133
}
134134

135-
// TODO: There has to be a better way to do this...
136-
if cs.UserRunsCC && !cccid.Syscc {
137-
chaincodeLogger.Error(
138-
"You are attempting to perform an action other than Deploy on Chaincode that is not ready and you are in developer mode. Did you forget to Deploy your chaincode?",
139-
)
140-
}
141-
142135
chaincodeName := spec.GetChaincodeSpec().Name()
143136

144137
ccci, err := cs.Lifecycle.ChaincodeContainerInfo(cccid.ChainID, chaincodeName)
145138
if err != nil {
139+
// TODO: There has to be a better way to do this...
140+
if cs.UserRunsCC {
141+
chaincodeLogger.Error(
142+
"You are attempting to perform an action other than Deploy on Chaincode that is not ready and you are in developer mode. Did you forget to Deploy your chaincode?",
143+
)
144+
}
145+
146146
return errors.Wrapf(err, "[channel %s] failed to get chaincode container info for %s", cccid.ChainID, chaincodeName)
147147
}
148148

core/chaincode/chaincode_support_test.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ func deployCC(t *testing.T, ctx context.Context, cccid *ccprovider.CCContext, sp
399399
lsccSpec := &pb.ChaincodeInvocationSpec{ChaincodeSpec: &pb.ChaincodeSpec{Type: pb.ChaincodeSpec_GOLANG, ChaincodeId: &pb.ChaincodeID{Name: "lscc", Version: sysCCVers}, Input: &pb.ChaincodeInput{Args: [][]byte{[]byte("deploy"), []byte(cccid.ChainID), b}}}}
400400

401401
sprop, prop := putils.MockSignedEndorserProposal2OrPanic(cccid.ChainID, lsccSpec.ChaincodeSpec, signer)
402-
lsccid := ccprovider.NewCCContext(cccid.ChainID, lsccSpec.ChaincodeSpec.ChaincodeId.Name, sysCCVers, cccid.TxID, true, sprop, prop)
402+
lsccid := ccprovider.NewCCContext(cccid.ChainID, lsccSpec.ChaincodeSpec.ChaincodeId.Name, sysCCVers, cccid.TxID, sprop, prop)
403403

404404
//write to lscc
405405
if _, _, err := chaincodeSupport.Execute(ctx, lsccid, lsccSpec); err != nil {
@@ -443,13 +443,13 @@ func initializeCC(t *testing.T, chainID, ccname string, ccSide *mockpeer.MockCCC
443443
Responses: []*mockpeer.MockResponse{resp},
444444
}
445445

446-
cccid := ccprovider.NewCCContext(chainID, ccname, "0", txid, false, sprop, prop)
446+
cccid := ccprovider.NewCCContext(chainID, ccname, "0", txid, sprop, prop)
447447
execCC(t, ctxt, ccSide, cccid, false, true, done, cis, respSet, chaincodeSupport)
448448

449449
//set the right TxID in response now
450450
resp.RespMsg.(*pb.ChaincodeMessage).Txid = txid
451451

452-
badcccid := ccprovider.NewCCContext(chainID, ccname, "unknownver", txid, false, sprop, prop)
452+
badcccid := ccprovider.NewCCContext(chainID, ccname, "unknownver", txid, sprop, prop)
453453

454454
//we are not going to reach the chaincode and so won't get a response from it. processDone will not
455455
//be triggered by the chaincode stream. We just expect an error from fabric. Hence pass nil for done
@@ -513,7 +513,7 @@ func invokeCC(t *testing.T, chainID, ccname string, ccSide *mockpeer.MockCCComm,
513513
},
514514
}
515515

516-
cccid := ccprovider.NewCCContext(chainID, ccname, "0", txid, false, sprop, prop)
516+
cccid := ccprovider.NewCCContext(chainID, ccname, "0", txid, sprop, prop)
517517
execCC(t, ctxt, ccSide, cccid, false, false, done, cis, respSet, chaincodeSupport)
518518

519519
//delete the extra var
@@ -570,7 +570,7 @@ func invokePrivateDataGetPutDelCC(t *testing.T, chainID, ccname string, ccSide *
570570
},
571571
}
572572

573-
cccid := ccprovider.NewCCContext(chainID, ccname, "0", txid, false, sprop, prop)
573+
cccid := ccprovider.NewCCContext(chainID, ccname, "0", txid, sprop, prop)
574574
execCC(t, ctxt, ccSide, cccid, false, true, done, cis, respSet, chaincodeSupport)
575575

576576
respSet = &mockpeer.MockResponseSet{
@@ -586,7 +586,7 @@ func invokePrivateDataGetPutDelCC(t *testing.T, chainID, ccname string, ccSide *
586586
},
587587
}
588588

589-
cccid = ccprovider.NewCCContext(chainID, ccname, "0", txid, false, sprop, prop)
589+
cccid = ccprovider.NewCCContext(chainID, ccname, "0", txid, sprop, prop)
590590
execCC(t, ctxt, ccSide, cccid, false, false, done, cis, respSet, chaincodeSupport)
591591

592592
endTx(t, cccid, txsim, cis)
@@ -603,7 +603,7 @@ func invokePrivateDataGetPutDelCC(t *testing.T, chainID, ccname string, ccSide *
603603
},
604604
}
605605

606-
cccid = ccprovider.NewCCContext(chainID, ccname, "0", txid, false, sprop, prop)
606+
cccid = ccprovider.NewCCContext(chainID, ccname, "0", txid, sprop, prop)
607607
execCC(t, ctxt, ccSide, cccid, false, true, done, cis, respSet, chaincodeSupport)
608608

609609
endTx(t, cccid, txsim, cis)
@@ -676,7 +676,7 @@ func getQueryStateByRange(t *testing.T, collection, chainID, ccname string, ccSi
676676
Responses: mkpeer,
677677
}
678678

679-
cccid := ccprovider.NewCCContext(chainID, ccname, "0", txid, false, sprop, prop)
679+
cccid := ccprovider.NewCCContext(chainID, ccname, "0", txid, sprop, prop)
680680
if collection == "" {
681681
execCC(t, ctxt, ccSide, cccid, false, false, done, cis, respSet, chaincodeSupport)
682682
} else {
@@ -717,7 +717,7 @@ func cc2cc(t *testing.T, chainID, chainID2, ccname string, ccSide *mockpeer.Mock
717717
mockAclProvider.On("CheckACL", resources.Lscc_GetChaincodeData, chainID, sprop).Return(nil)
718718
mockAclProvider.On("CheckACL", resources.Peer_Propose, chainID, sprop).Return(nil)
719719

720-
cccid := ccprovider.NewCCContext(chainID, calledCC, "0", txid, false, sprop, prop)
720+
cccid := ccprovider.NewCCContext(chainID, calledCC, "0", txid, sprop, prop)
721721

722722
deployCC(t, ctxt, cccid, cis.ChaincodeSpec, chaincodeSupport)
723723

@@ -763,7 +763,7 @@ func cc2cc(t *testing.T, chainID, chainID2, ccname string, ccSide *mockpeer.Mock
763763
}
764764
calledCCSide.SetResponses(respSet2)
765765

766-
cccid = ccprovider.NewCCContext(chainID, ccname, "0", txid, false, sprop, prop)
766+
cccid = ccprovider.NewCCContext(chainID, ccname, "0", txid, sprop, prop)
767767

768768
execCC(t, ctxt, ccSide, cccid, false, true, done, cis, respSet, chaincodeSupport)
769769

@@ -803,7 +803,7 @@ func cc2cc(t *testing.T, chainID, chainID2, ccname string, ccSide *mockpeer.Mock
803803

804804
calledCCSide.SetResponses(respSet2)
805805

806-
cccid = ccprovider.NewCCContext(chainID, ccname, "0", txid, false, sprop, prop)
806+
cccid = ccprovider.NewCCContext(chainID, ccname, "0", txid, sprop, prop)
807807

808808
execCC(t, ctxt, ccSide, cccid, false, true, done, cis, respSet, chaincodeSupport)
809809

@@ -887,7 +887,7 @@ func getQueryResult(t *testing.T, collection, chainID, ccname string, ccSide *mo
887887
Responses: mkpeer,
888888
}
889889

890-
cccid := ccprovider.NewCCContext(chainID, ccname, "0", txid, false, sprop, prop)
890+
cccid := ccprovider.NewCCContext(chainID, ccname, "0", txid, sprop, prop)
891891
if collection == "" {
892892
execCC(t, ctxt, ccSide, cccid, false, false, done, cis, respSet, chaincodeSupport)
893893
} else {
@@ -952,7 +952,7 @@ func getHistory(t *testing.T, chainID, ccname string, ccSide *mockpeer.MockCCCom
952952
},
953953
}
954954

955-
cccid := ccprovider.NewCCContext(chainID, ccname, "0", txid, false, sprop, prop)
955+
cccid := ccprovider.NewCCContext(chainID, ccname, "0", txid, sprop, prop)
956956
execCC(t, ctxt, ccSide, cccid, false, false, done, cis, respSet, chaincodeSupport)
957957

958958
endTx(t, cccid, txsim, cis)
@@ -962,7 +962,7 @@ func getHistory(t *testing.T, chainID, ccname string, ccSide *mockpeer.MockCCCom
962962

963963
func getLaunchConfigs(t *testing.T, cr *ContainerRuntime) {
964964
gt := NewGomegaWithT(t)
965-
ccContext := ccprovider.NewCCContext("dummyChannelId", "mycc", "v0", "dummyTxid", false, nil, nil)
965+
ccContext := ccprovider.NewCCContext("dummyChannelId", "mycc", "v0", "dummyTxid", nil, nil)
966966
lc, err := cr.LaunchConfig(ccContext.GetCanonicalName(), pb.ChaincodeSpec_GOLANG.String())
967967
if err != nil {
968968
t.Fatalf("calling getLaunchConfigs() failed with error %s", err)
@@ -1262,7 +1262,7 @@ func cc2SameCC(t *testing.T, chainID, chainID2, ccname string, ccSide *mockpeer.
12621262
mockAclProvider.On("CheckACL", resources.Lscc_GetChaincodeData, chainID2, sprop).Return(nil)
12631263
mockAclProvider.On("CheckACL", resources.Peer_Propose, chainID2, sprop).Return(nil)
12641264

1265-
cccid := ccprovider.NewCCContext(chainID2, ccname, "0", txid, false, sprop, prop)
1265+
cccid := ccprovider.NewCCContext(chainID2, ccname, "0", txid, sprop, prop)
12661266

12671267
deployCC(t, ctxt, cccid, cis.ChaincodeSpec, chaincodeSupport)
12681268

@@ -1302,7 +1302,7 @@ func cc2SameCC(t *testing.T, chainID, chainID2, ccname string, ccSide *mockpeer.
13021302
},
13031303
}
13041304

1305-
cccid = ccprovider.NewCCContext(chainID, ccname, "0", txid, false, sprop, prop)
1305+
cccid = ccprovider.NewCCContext(chainID, ccname, "0", txid, sprop, prop)
13061306

13071307
execCC(t, ctxt, ccSide, cccid, false, true, done, cis, respSet, chaincodeSupport)
13081308

core/chaincode/exectransaction_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ func deploy2(ctx context.Context, cccid *ccprovider.CCContext, chaincodeDeployme
444444

445445
sysCCVers := util.GetSysCCVersion()
446446
sprop, prop := putils.MockSignedEndorserProposal2OrPanic(cccid.ChainID, cis.ChaincodeSpec, signer)
447-
lsccid := ccprovider.NewCCContext(cccid.ChainID, cis.ChaincodeSpec.ChaincodeId.Name, sysCCVers, uuid, true, sprop, prop)
447+
lsccid := ccprovider.NewCCContext(cccid.ChainID, cis.ChaincodeSpec.ChaincodeId.Name, sysCCVers, uuid, sprop, prop)
448448

449449
//write to lscc
450450
if _, _, err = chaincodeSupport.Execute(ctx, lsccid, cis); err != nil {
@@ -492,7 +492,7 @@ func invokeWithVersion(ctx context.Context, chainID string, version string, spec
492492
creator = []byte("Admin")
493493
}
494494
sprop, prop := putils.MockSignedEndorserProposalOrPanic(chainID, spec, creator, []byte("msg1"))
495-
cccid := ccprovider.NewCCContext(chainID, cdInvocationSpec.ChaincodeSpec.ChaincodeId.Name, version, uuid, false, sprop, prop)
495+
cccid := ccprovider.NewCCContext(chainID, cdInvocationSpec.ChaincodeSpec.ChaincodeId.Name, version, uuid, sprop, prop)
496496
var resp *pb.Response
497497
resp, ccevt, err = chaincodeSupport.Execute(ctx, cccid, cdInvocationSpec)
498498
if err != nil {
@@ -526,7 +526,7 @@ func executeDeployTransaction(t *testing.T, chainID string, name string, url str
526526
args := util.ToChaincodeArgs(f, "a", "100", "b", "200")
527527
spec := &pb.ChaincodeSpec{Type: 1, ChaincodeId: &pb.ChaincodeID{Name: name, Path: url, Version: "0"}, Input: &pb.ChaincodeInput{Args: args}}
528528

529-
cccid := ccprovider.NewCCContext(chainID, name, "0", "", false, nil, nil)
529+
cccid := ccprovider.NewCCContext(chainID, name, "0", "", nil, nil)
530530

531531
defer chaincodeSupport.Stop(
532532
ccprovider.DeploymentSpecToChaincodeContainerInfo(
@@ -907,7 +907,7 @@ func TestChaincodeInvokeChaincodeErrorCase(t *testing.T) {
907907
spec1 := &pb.ChaincodeSpec{Type: 1, ChaincodeId: cID1, Input: &pb.ChaincodeInput{Args: args}}
908908

909909
sProp, prop := putils.MockSignedEndorserProposalOrPanic(util.GetTestChainID(), spec1, []byte([]byte("Alice")), nil)
910-
cccid1 := ccprovider.NewCCContext(chainID, "example02", "0", "", false, sProp, prop)
910+
cccid1 := ccprovider.NewCCContext(chainID, "example02", "0", "", sProp, prop)
911911

912912
var nextBlockNumber uint64 = 1
913913
defer chaincodeSupport.Stop(&ccprovider.ChaincodeContainerInfo{
@@ -936,7 +936,7 @@ func TestChaincodeInvokeChaincodeErrorCase(t *testing.T) {
936936

937937
spec2 := &pb.ChaincodeSpec{Type: 1, ChaincodeId: cID2, Input: &pb.ChaincodeInput{Args: args}}
938938

939-
cccid2 := ccprovider.NewCCContext(chainID, "pthru", "0", "", false, sProp, prop)
939+
cccid2 := ccprovider.NewCCContext(chainID, "pthru", "0", "", sProp, prop)
940940

941941
defer chaincodeSupport.Stop(&ccprovider.ChaincodeContainerInfo{
942942
Name: cID2.Name,
@@ -1002,7 +1002,7 @@ func TestQueries(t *testing.T) {
10021002

10031003
spec := &pb.ChaincodeSpec{Type: 1, ChaincodeId: cID, Input: &pb.ChaincodeInput{Args: args}}
10041004

1005-
cccid := ccprovider.NewCCContext(chainID, "tmap", "0", "", false, nil, nil)
1005+
cccid := ccprovider.NewCCContext(chainID, "tmap", "0", "", nil, nil)
10061006

10071007
defer chaincodeSupport.Stop(&ccprovider.ChaincodeContainerInfo{
10081008
Name: cID.Name,
@@ -1359,7 +1359,7 @@ func deployChaincode(ctx context.Context, name string, version string, chaincode
13591359

13601360
signedProposal, proposal := putils.MockSignedEndorserProposal2OrPanic(channel, chaincodeSpec, signer)
13611361

1362-
chaincodeCtx := ccprovider.NewCCContext(channel, name, version, "", false, signedProposal, proposal)
1362+
chaincodeCtx := ccprovider.NewCCContext(channel, name, version, "", signedProposal, proposal)
13631363

13641364
result, err := deploy(ctx, chaincodeCtx, chaincodeSpec, nextBlockNumber, chaincodeSupport)
13651365
if err != nil {

core/chaincode/executetransaction_pvtdata_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func TestQueriesPrivateData(t *testing.T) {
4747

4848
spec := &pb.ChaincodeSpec{Type: 1, ChaincodeId: cID, Input: &pb.ChaincodeInput{Args: args}}
4949

50-
cccid := ccprovider.NewCCContext(chainID, "tmap", "0", "", false, nil, nil)
50+
cccid := ccprovider.NewCCContext(chainID, "tmap", "0", "", nil, nil)
5151

5252
var nextBlockNumber uint64 = 1
5353
// this test assumes four collections

core/chaincode/handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ func (h *Handler) HandleInvokeChaincode(msg *pb.ChaincodeMessage, txContext *Tra
874874
// Launch the new chaincode if not already running
875875
chaincodeLogger.Debugf("[%s] launching chaincode %s on channel %s", shorttxid(msg.Txid), targetInstance.ChaincodeName, targetInstance.ChainID)
876876

877-
cccid := ccprovider.NewCCContext(targetInstance.ChainID, targetInstance.ChaincodeName, version, msg.Txid, false, txContext.SignedProp, txContext.Proposal)
877+
cccid := ccprovider.NewCCContext(targetInstance.ChainID, targetInstance.ChaincodeName, version, msg.Txid, txContext.SignedProp, txContext.Proposal)
878878
cciSpec := &pb.ChaincodeInvocationSpec{ChaincodeSpec: chaincodeSpec}
879879

880880
// Execute the chaincode... this CANNOT be an init at least for now

core/chaincode/handler_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1714,7 +1714,7 @@ var _ = Describe("Handler", func() {
17141714
Signature: []byte("signature"),
17151715
}
17161716

1717-
cccid = ccprovider.NewCCContext("channel-name", "chaincode-name", "chaincode-version", "tx-id", false, expectedSignedProp, expectedProposal)
1717+
cccid = ccprovider.NewCCContext("channel-name", "chaincode-name", "chaincode-version", "tx-id", expectedSignedProp, expectedProposal)
17181718
incomingMessage = &pb.ChaincodeMessage{
17191719
Type: pb.ChaincodeMessage_TRANSACTION,
17201720
Txid: "tx-id",
@@ -1777,7 +1777,7 @@ var _ = Describe("Handler", func() {
17771777

17781778
Context("when the proposal is missing", func() {
17791779
BeforeEach(func() {
1780-
cccid = ccprovider.NewCCContext("channel-name", "chaincode-name", "chaincode-version", "tx-id", false, expectedSignedProp, nil)
1780+
cccid = ccprovider.NewCCContext("channel-name", "chaincode-name", "chaincode-version", "tx-id", expectedSignedProp, nil)
17811781
})
17821782

17831783
It("sends a nil proposal", func() {
@@ -1794,7 +1794,7 @@ var _ = Describe("Handler", func() {
17941794

17951795
Context("when the signed proposal is missing", func() {
17961796
BeforeEach(func() {
1797-
cccid = ccprovider.NewCCContext("channel-name", "chaincode-name", "chaincode-version", "tx-id", false, nil, expectedProposal)
1797+
cccid = ccprovider.NewCCContext("channel-name", "chaincode-name", "chaincode-version", "tx-id", nil, expectedProposal)
17981798
})
17991799

18001800
It("returns an error", func() {
@@ -2117,7 +2117,7 @@ var _ = Describe("Handler", func() {
21172117

21182118
expectedProposal = &pb.Proposal{}
21192119
expectedSignedProp = &pb.SignedProposal{}
2120-
cccid = ccprovider.NewCCContext("channel-name", "chaincode-name", "chaincode-version", "tx-id", false, expectedSignedProp, expectedProposal)
2120+
cccid = ccprovider.NewCCContext("channel-name", "chaincode-name", "chaincode-version", "tx-id", expectedSignedProp, expectedProposal)
21212121

21222122
incomingMessage = &pb.ChaincodeMessage{
21232123
Type: pb.ChaincodeMessage_TRANSACTION,

core/common/ccprovider/ccinfocache_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,16 +211,16 @@ func TestGetInstalledChaincodesErrorPaths(t *testing.T) {
211211
}
212212

213213
func TestNewCCContext(t *testing.T) {
214-
ccctx := NewCCContext("foo", "foo", "1.0", "", false, nil, nil)
214+
ccctx := NewCCContext("foo", "foo", "1.0", "", nil, nil)
215215
assert.NotNil(t, ccctx)
216216
canName := ccctx.GetCanonicalName()
217217
assert.NotEmpty(t, canName)
218218

219219
assert.Panics(t, func() {
220-
NewCCContext("foo", "foo", "", "", false, nil, nil)
220+
NewCCContext("foo", "foo", "", "", nil, nil)
221221
}, "NewCCContext should have paniced if version is empty")
222222

223-
ccctx = &CCContext{"foo", "foo", "1.0", "", false, nil, nil, "", nil}
223+
ccctx = &CCContext{"foo", "foo", "1.0", "", nil, nil, "", nil}
224224
assert.Panics(t, func() {
225225
ccctx.GetCanonicalName()
226226
}, "GetConnonicalName should have paniced if cannonical name is empty")

core/common/ccprovider/ccprovider.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,6 @@ type CCContext struct {
364364
// TxID is the transaction id for the proposal (if any)
365365
TxID string
366366

367-
// Syscc is this a system chaincode
368-
Syscc bool
369-
370367
// SignedProposal for this invoke (if any) this is kept here for access
371368
// control and in case we need to pass something from this to the chaincode
372369
SignedProposal *pb.SignedProposal
@@ -383,13 +380,12 @@ type CCContext struct {
383380
}
384381

385382
// NewCCContext just construct a new struct with whatever args
386-
func NewCCContext(cname, name, version, txid string, syscc bool, signedProp *pb.SignedProposal, prop *pb.Proposal) *CCContext {
383+
func NewCCContext(cname, name, version, txid string, signedProp *pb.SignedProposal, prop *pb.Proposal) *CCContext {
387384
cccid := &CCContext{
388385
ChainID: cname,
389386
Name: name,
390387
Version: version,
391388
TxID: txid,
392-
Syscc: syscc,
393389
SignedProposal: signedProp,
394390
Proposal: prop,
395391
canonicalName: name + ":" + version,
@@ -407,8 +403,8 @@ func NewCCContext(cname, name, version, txid string, syscc bool, signedProp *pb.
407403
}
408404

409405
func (cccid *CCContext) String() string {
410-
return fmt.Sprintf("chain=%s,chaincode=%s,version=%s,txid=%s,syscc=%t,proposal=%p,canname=%s",
411-
cccid.ChainID, cccid.Name, cccid.Version, cccid.TxID, cccid.Syscc, cccid.Proposal, cccid.canonicalName)
406+
return fmt.Sprintf("chain=%s,chaincode=%s,version=%s,txid=%s,proposal=%p,canname=%s",
407+
cccid.ChainID, cccid.Name, cccid.Version, cccid.TxID, cccid.Proposal, cccid.canonicalName)
412408
}
413409

414410
// GetCanonicalName returns the canonical name associated with the proposal context
@@ -543,7 +539,7 @@ type ChaincodeProvider interface {
543539
Execute(ctxt context.Context, cccid *CCContext, spec *pb.ChaincodeInvocationSpec) (*pb.Response, *pb.ChaincodeEvent, error)
544540
// ExecuteInit is a special case for executing chaincode deployment specs, needed for old lifecycle
545541
ExecuteInit(ctxt context.Context, cccid *CCContext, spec *pb.ChaincodeDeploymentSpec) (*pb.Response, *pb.ChaincodeEvent, error)
546-
// Stop stops the chaincode given
542+
// Stop stops the chaincode give
547543
Stop(ccci *ChaincodeContainerInfo) error
548544
}
549545

core/endorser/endorser.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ type Support interface {
5959
IsSysCC(name string) bool
6060

6161
// Execute - execute proposal, return original response of chaincode
62-
Execute(ctxt context.Context, cid, name, version, txid string, syscc bool, signedProp *pb.SignedProposal, prop *pb.Proposal, spec *pb.ChaincodeInvocationSpec) (*pb.Response, *pb.ChaincodeEvent, error)
62+
Execute(ctxt context.Context, cid, name, version, txid string, signedProp *pb.SignedProposal, prop *pb.Proposal, spec *pb.ChaincodeInvocationSpec) (*pb.Response, *pb.ChaincodeEvent, error)
6363

6464
// ExecuteInit - executes a deployment proposal, return original response of chaincode
65-
ExecuteInit(ctxt context.Context, cid, name, version, txid string, syscc bool, signedProp *pb.SignedProposal, prop *pb.Proposal, spec *pb.ChaincodeDeploymentSpec) (*pb.Response, *pb.ChaincodeEvent, error)
65+
ExecuteInit(ctxt context.Context, cid, name, version, txid string, signedProp *pb.SignedProposal, prop *pb.Proposal, spec *pb.ChaincodeDeploymentSpec) (*pb.Response, *pb.ChaincodeEvent, error)
6666

6767
// GetChaincodeDefinition returns ccprovider.ChaincodeDefinition for the chaincode with the supplied name
6868
GetChaincodeDefinition(chaincodeID string, txsim ledger.QueryExecutor) (ccprovider.ChaincodeDefinition, error)
@@ -137,9 +137,7 @@ func (e *Endorser) callChaincode(ctxt context.Context, chainID string, version s
137137
}
138138

139139
// is this a system chaincode
140-
scc := e.s.IsSysCC(cid.Name)
141-
142-
res, ccevent, err = e.s.Execute(ctxt, chainID, cid.Name, version, txid, scc, signedProp, prop, cis)
140+
res, ccevent, err = e.s.Execute(ctxt, chainID, cid.Name, version, txid, signedProp, prop, cis)
143141
if err != nil {
144142
return nil, nil, err
145143
}
@@ -176,7 +174,7 @@ func (e *Endorser) callChaincode(ctxt context.Context, chainID string, version s
176174
return nil, nil, errors.Errorf("attempting to deploy a system chaincode %s/%s", cds.ChaincodeSpec.ChaincodeId.Name, chainID)
177175
}
178176

179-
_, _, err = e.s.ExecuteInit(ctxt, chainID, cds.ChaincodeSpec.ChaincodeId.Name, cds.ChaincodeSpec.ChaincodeId.Version, txid, false, signedProp, prop, cds)
177+
_, _, err = e.s.ExecuteInit(ctxt, chainID, cds.ChaincodeSpec.ChaincodeId.Name, cds.ChaincodeSpec.ChaincodeId.Version, txid, signedProp, prop, cds)
180178
if err != nil {
181179
return nil, nil, err
182180
}

0 commit comments

Comments
 (0)