Skip to content

Commit

Permalink
FAB-11031 Remove 'Syscc' from CCContext
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jason Yellick committed Jul 16, 2018
1 parent e67a85f commit d72773e
Show file tree
Hide file tree
Showing 13 changed files with 68 additions and 78 deletions.
14 changes: 7 additions & 7 deletions core/chaincode/chaincode_support.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,17 @@ func (cs *ChaincodeSupport) Launch(cccid *ccprovider.CCContext, spec *pb.Chainco
return nil
}

// TODO: There has to be a better way to do this...
if cs.UserRunsCC && !cccid.Syscc {
chaincodeLogger.Error(
"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?",
)
}

chaincodeName := spec.GetChaincodeSpec().Name()

ccci, err := cs.Lifecycle.ChaincodeContainerInfo(cccid.ChainID, chaincodeName)
if err != nil {
// TODO: There has to be a better way to do this...
if cs.UserRunsCC {
chaincodeLogger.Error(
"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?",
)
}

return errors.Wrapf(err, "[channel %s] failed to get chaincode container info for %s", cccid.ChainID, chaincodeName)
}

Expand Down
32 changes: 16 additions & 16 deletions core/chaincode/chaincode_support_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ func deployCC(t *testing.T, ctx context.Context, cccid *ccprovider.CCContext, sp
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}}}}

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

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

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

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

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

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

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

//delete the extra var
Expand Down Expand Up @@ -570,7 +570,7 @@ func invokePrivateDataGetPutDelCC(t *testing.T, chainID, ccname string, ccSide *
},
}

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

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

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

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

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

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

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

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

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

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

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

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

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

calledCCSide.SetResponses(respSet2)

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

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

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

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

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

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

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

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

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

Expand Down Expand Up @@ -1302,7 +1302,7 @@ func cc2SameCC(t *testing.T, chainID, chainID2, ccname string, ccSide *mockpeer.
},
}

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

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

Expand Down
14 changes: 7 additions & 7 deletions core/chaincode/exectransaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ func deploy2(ctx context.Context, cccid *ccprovider.CCContext, chaincodeDeployme

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

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

cccid := ccprovider.NewCCContext(chainID, name, "0", "", false, nil, nil)
cccid := ccprovider.NewCCContext(chainID, name, "0", "", nil, nil)

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

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

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

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

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

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

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

cccid := ccprovider.NewCCContext(chainID, "tmap", "0", "", false, nil, nil)
cccid := ccprovider.NewCCContext(chainID, "tmap", "0", "", nil, nil)

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

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

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

result, err := deploy(ctx, chaincodeCtx, chaincodeSpec, nextBlockNumber, chaincodeSupport)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion core/chaincode/executetransaction_pvtdata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestQueriesPrivateData(t *testing.T) {

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

cccid := ccprovider.NewCCContext(chainID, "tmap", "0", "", false, nil, nil)
cccid := ccprovider.NewCCContext(chainID, "tmap", "0", "", nil, nil)

var nextBlockNumber uint64 = 1
// this test assumes four collections
Expand Down
2 changes: 1 addition & 1 deletion core/chaincode/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ func (h *Handler) HandleInvokeChaincode(msg *pb.ChaincodeMessage, txContext *Tra
// Launch the new chaincode if not already running
chaincodeLogger.Debugf("[%s] launching chaincode %s on channel %s", shorttxid(msg.Txid), targetInstance.ChaincodeName, targetInstance.ChainID)

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

// Execute the chaincode... this CANNOT be an init at least for now
Expand Down
8 changes: 4 additions & 4 deletions core/chaincode/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1714,7 +1714,7 @@ var _ = Describe("Handler", func() {
Signature: []byte("signature"),
}

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

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

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

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

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

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

incomingMessage = &pb.ChaincodeMessage{
Type: pb.ChaincodeMessage_TRANSACTION,
Expand Down
6 changes: 3 additions & 3 deletions core/common/ccprovider/ccinfocache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,16 +211,16 @@ func TestGetInstalledChaincodesErrorPaths(t *testing.T) {
}

func TestNewCCContext(t *testing.T) {
ccctx := NewCCContext("foo", "foo", "1.0", "", false, nil, nil)
ccctx := NewCCContext("foo", "foo", "1.0", "", nil, nil)
assert.NotNil(t, ccctx)
canName := ccctx.GetCanonicalName()
assert.NotEmpty(t, canName)

assert.Panics(t, func() {
NewCCContext("foo", "foo", "", "", false, nil, nil)
NewCCContext("foo", "foo", "", "", nil, nil)
}, "NewCCContext should have paniced if version is empty")

ccctx = &CCContext{"foo", "foo", "1.0", "", false, nil, nil, "", nil}
ccctx = &CCContext{"foo", "foo", "1.0", "", nil, nil, "", nil}
assert.Panics(t, func() {
ccctx.GetCanonicalName()
}, "GetConnonicalName should have paniced if cannonical name is empty")
Expand Down
12 changes: 4 additions & 8 deletions core/common/ccprovider/ccprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,6 @@ type CCContext struct {
// TxID is the transaction id for the proposal (if any)
TxID string

// Syscc is this a system chaincode
Syscc bool

// SignedProposal for this invoke (if any) this is kept here for access
// control and in case we need to pass something from this to the chaincode
SignedProposal *pb.SignedProposal
Expand All @@ -383,13 +380,12 @@ type CCContext struct {
}

// NewCCContext just construct a new struct with whatever args
func NewCCContext(cname, name, version, txid string, syscc bool, signedProp *pb.SignedProposal, prop *pb.Proposal) *CCContext {
func NewCCContext(cname, name, version, txid string, signedProp *pb.SignedProposal, prop *pb.Proposal) *CCContext {
cccid := &CCContext{
ChainID: cname,
Name: name,
Version: version,
TxID: txid,
Syscc: syscc,
SignedProposal: signedProp,
Proposal: prop,
canonicalName: name + ":" + version,
Expand All @@ -407,8 +403,8 @@ func NewCCContext(cname, name, version, txid string, syscc bool, signedProp *pb.
}

func (cccid *CCContext) String() string {
return fmt.Sprintf("chain=%s,chaincode=%s,version=%s,txid=%s,syscc=%t,proposal=%p,canname=%s",
cccid.ChainID, cccid.Name, cccid.Version, cccid.TxID, cccid.Syscc, cccid.Proposal, cccid.canonicalName)
return fmt.Sprintf("chain=%s,chaincode=%s,version=%s,txid=%s,proposal=%p,canname=%s",
cccid.ChainID, cccid.Name, cccid.Version, cccid.TxID, cccid.Proposal, cccid.canonicalName)
}

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

Expand Down
10 changes: 4 additions & 6 deletions core/endorser/endorser.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ type Support interface {
IsSysCC(name string) bool

// Execute - execute proposal, return original response of chaincode
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)
Execute(ctxt context.Context, cid, name, version, txid string, signedProp *pb.SignedProposal, prop *pb.Proposal, spec *pb.ChaincodeInvocationSpec) (*pb.Response, *pb.ChaincodeEvent, error)

// ExecuteInit - executes a deployment proposal, return original response of chaincode
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)
ExecuteInit(ctxt context.Context, cid, name, version, txid string, signedProp *pb.SignedProposal, prop *pb.Proposal, spec *pb.ChaincodeDeploymentSpec) (*pb.Response, *pb.ChaincodeEvent, error)

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

// is this a system chaincode
scc := e.s.IsSysCC(cid.Name)

res, ccevent, err = e.s.Execute(ctxt, chainID, cid.Name, version, txid, scc, signedProp, prop, cis)
res, ccevent, err = e.s.Execute(ctxt, chainID, cid.Name, version, txid, signedProp, prop, cis)
if err != nil {
return nil, nil, err
}
Expand Down Expand Up @@ -176,7 +174,7 @@ func (e *Endorser) callChaincode(ctxt context.Context, chainID string, version s
return nil, nil, errors.Errorf("attempting to deploy a system chaincode %s/%s", cds.ChaincodeSpec.ChaincodeId.Name, chainID)
}

_, _, err = e.s.ExecuteInit(ctxt, chainID, cds.ChaincodeSpec.ChaincodeId.Name, cds.ChaincodeSpec.ChaincodeId.Version, txid, false, signedProp, prop, cds)
_, _, err = e.s.ExecuteInit(ctxt, chainID, cds.ChaincodeSpec.ChaincodeId.Name, cds.ChaincodeSpec.ChaincodeId.Version, txid, signedProp, prop, cds)
if err != nil {
return nil, nil, err
}
Expand Down
Loading

0 comments on commit d72773e

Please sign in to comment.