Skip to content

Commit c950903

Browse files
committed
Use SHA256 TXID instead of UUID
This squashed changeset does the following: - It renames UUID to TXID in the code (Go/Java), in tests, in proto files, in all chaincode related files - It uses all the arguments of the chaincode to generate the TXID Change-Id: Iae6f1fb45c12c2652d9ad18451e75ea1f91fe9a3 Signed-off-by: Gabor Hosszu <[email protected]>
1 parent f062bd5 commit c950903

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+718
-670
lines changed

bddtests/peer_basic.feature

+7-7
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,8 @@ Feature: Network of Peers
350350
# @doNotDecompose
351351
# @wip
352352
# Arg[0] = a, base64 = 'YQ=='
353-
# sha256 = 'ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb'
353+
# sha256 = 'acfb280369a87a57b1954210081d78943f1a0adb5368184984e8852a42c14df8'
354+
# calculated using all the args
354355
Scenario: chaincode map single peer content generated ID
355356
Given we compose "docker-compose-1.yml"
356357
When requesting "/chain" from "vp0"
@@ -361,12 +362,12 @@ Feature: Network of Peers
361362
Then I should have received a chaincode name
362363
Then I wait up to "60" seconds for transaction to be committed to all peers
363364

364-
When I invoke chaincode "map" function name "put" on "vp0" with "sha256base64"
365+
When I invoke chaincode "map" function name "put" on "vp0" with "sha256"
365366
| arg1 |arg2|
366367
| YQ== | 10 |
367368
Then I should have received a transactionID
368369
Then I wait up to "25" seconds for transaction to be committed to all peers
369-
Then I check the transaction ID if it is "ca978112-ca1b-bdca-fac2-31b39a23dc4d"
370+
Then I check the transaction ID if it is "acfb280369a87a57b1954210081d78943f1a0adb5368184984e8852a42c14df8"
370371

371372
Scenario: chaincode example 01 single peer rejection message
372373
Given we compose "docker-compose-1-exp.yml"
@@ -1106,7 +1107,7 @@ Feature: Network of Peers
11061107

11071108

11081109
@issue_1942
1109-
#@doNotDecompose
1110+
# @doNotDecompose
11101111
Scenario: chaincode example02 with 4 peers, stop and start alternates, reverse
11111112
Given we compose "docker-compose-4-consensus-batch.yml"
11121113
And I register with CA supplying username "binhn" and secret "7avZQLwcUe9q" on peers:
@@ -1152,15 +1153,14 @@ Scenario: chaincode example02 with 4 peers, stop and start alternates, reverse
11521153

11531154
Given I start peers:
11541155
| vp2 |
1155-
And I wait "30" seconds
11561156

1157+
And I wait "30" seconds
11571158
Given I stop peers:
11581159
| vp1 |
11591160
When I invoke chaincode "example2" function name "invoke" on "vp3" "20" times
11601161
|arg1|arg2|arg3|
11611162
| a | b | 1 |
1162-
Then I should have received a transactionID
1163-
Then I wait up to "300" seconds for transaction to be committed to peers:
1163+
Then I wait up to "300" seconds for transactions to be committed to peers:
11641164
| vp0 | vp2 | vp3 |
11651165

11661166
When I query chaincode "example2" function name "query" with value "a" on peers:

bddtests/steps/peer_basic_impl.py

+49
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,12 @@ def step_impl(context, chaincodeName, functionName, containerName, idGenAlg):
311311
@when(u'I invoke chaincode "{chaincodeName}" function name "{functionName}" on "{containerName}" "{times}" times')
312312
def step_impl(context, chaincodeName, functionName, containerName, times):
313313
assert 'chaincodeSpec' in context, "chaincodeSpec not found in context"
314+
ipAddress = bdd_test_util.ipFromContainerNamePart(containerName, context.compose_containers)
315+
request_url = buildUrl(context, ipAddress, "/chain")
316+
resp = requests.get(request_url, headers={'Accept': 'application/json'}, verify=False)
317+
assert resp.status_code == 200, "Failed to get chain height %s: %s" % (request_url,resp.text)
318+
context.chainheight = getAttributeFromJSON("height", resp.json(), "Height not found in response.")
319+
context.txcount = times
314320
for i in range(int(times)):
315321
invokeChaincode(context, "invoke", functionName, containerName)
316322

@@ -577,6 +583,49 @@ def step_impl(context, seconds):
577583
print("Result of request to all peers = {0}".format(respMap))
578584
print("")
579585

586+
@then(u'I wait up to "{seconds}" seconds for transactions to be committed to peers')
587+
def step_impl(context, seconds):
588+
assert 'chainheight' in context, "chainheight not found in context"
589+
assert 'txcount' in context, "txcount not found in context"
590+
assert 'compose_containers' in context, "compose_containers not found in context"
591+
assert 'table' in context, "table (of peers) not found in context"
592+
593+
aliases = context.table.headings
594+
containerDataList = bdd_test_util.getContainerDataValuesFromContext(context, aliases, lambda containerData: containerData)
595+
596+
# Build map of "containerName" : resp.statusCode
597+
respMap = {container.containerName:0 for container in containerDataList}
598+
599+
# Set the max time before stopping attempts
600+
maxTime = datetime.now() + timedelta(seconds = int(seconds))
601+
for container in containerDataList:
602+
ipAddress = container.ipAddress
603+
request_url = buildUrl(context, ipAddress, "/chain")
604+
605+
# Loop unless failure or time exceeded
606+
while (datetime.now() < maxTime):
607+
print("{0} GETing path = {1}".format(currentTime(), request_url))
608+
resp = requests.get(request_url, headers={'Accept': 'application/json'}, verify=False)
609+
if resp.status_code == 404:
610+
# Pause then try again
611+
respMap[container.containerName] = 404
612+
time.sleep(1)
613+
continue
614+
elif resp.status_code == 200:
615+
height = getAttributeFromJSON("height", resp.json(), "Height not found in response.")
616+
if height >= int(context.chainheight) + int(context.txcount):
617+
# Success, continue
618+
respMap[container.containerName] = 200
619+
break
620+
else:
621+
continue
622+
else:
623+
raise Exception("Error requesting {0}, returned result code = {1}".format(request_url, resp.status_code))
624+
else:
625+
raise Exception("Max time exceeded waiting for transactions with current response map = {0}".format(respMap))
626+
print("Result of request to all peers = {0}".format(respMap))
627+
print("")
628+
580629

581630
@then(u'I should get a rejection message in the listener after stopping it')
582631
def step_impl(context):

bddtests/syschaincode/noop/chaincode.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import (
3030
var logger = shim.NewLogger("noop")
3131

3232
type ledgerHandler interface {
33-
GetTransactionByUUID(txUUID string) (*protos.Transaction, error)
33+
GetTransactionByID(txID string) (*protos.Transaction, error)
3434
}
3535

3636
// SystemChaincode is type representing the chaincode
@@ -86,7 +86,7 @@ func (t *SystemChaincode) Query(stub *shim.ChaincodeStub, function string, args
8686
logger.Infof("--> %x", args[0])
8787

8888
var txHashHex = args[0]
89-
var tx, txerr = t.getLedger().GetTransactionByUUID(txHashHex)
89+
var tx, txerr = t.getLedger().GetTransactionByID(txHashHex)
9090
if nil != txerr || nil == tx {
9191
return nil, txerr
9292
}

bddtests/syschaincode/noop/chaincode_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ func TestQueryGetTranExisting(t *testing.T) {
111111
type mockLedger struct {
112112
}
113113

114-
func (ml mockLedger) GetTransactionByUUID(txUUID string) (*protos.Transaction, error) {
115-
if txUUID == "noSuchTX" {
114+
func (ml mockLedger) GetTransactionByID(txID string) (*protos.Transaction, error) {
115+
if txID == "noSuchTX" {
116116
return nil, fmt.Errorf("Some error")
117117
}
118118
newCCIS := &protos.ChaincodeInvocationSpec{ChaincodeSpec: &protos.ChaincodeSpec{CtorMsg: &protos.ChaincodeInput{Function: "execute", Args: []string{something}}}}

consensus/helper/engine.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func (eng *EngineImpl) ProcessTransactionMsg(msg *pb.Message, tx *pb.Transaction
6767
}
6868
} else {
6969
// Chaincode Transaction
70-
response = &pb.Response{Status: pb.Response_SUCCESS, Msg: []byte(tx.Uuid)}
70+
response = &pb.Response{Status: pb.Response_SUCCESS, Msg: []byte(tx.Txid)}
7171

7272
//TODO: Do we need to verify security, or can we supply a flag on the invoke ot this functions
7373
// If we fail to marshal or verify the tx, don't send it to consensus plugin

consensus/helper/helper.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,9 @@ func (h *Helper) ExecTxs(id interface{}, txs []*pb.Transaction) ([]byte, error)
191191
for i, e := range txerrs {
192192
//NOTE- it'll be nice if we can have error values. For now success == 0, error == 1
193193
if txerrs[i] != nil {
194-
txresults[i] = &pb.TransactionResult{Uuid: txs[i].Uuid, Error: e.Error(), ErrorCode: 1, ChaincodeEvent: ccevents[i]}
194+
txresults[i] = &pb.TransactionResult{Txid: txs[i].Txid, Error: e.Error(), ErrorCode: 1, ChaincodeEvent: ccevents[i]}
195195
} else {
196-
txresults[i] = &pb.TransactionResult{Uuid: txs[i].Uuid, ChaincodeEvent: ccevents[i]}
196+
txresults[i] = &pb.TransactionResult{Txid: txs[i].Txid, ChaincodeEvent: ccevents[i]}
197197
}
198198
}
199199
h.curBatchErrs = append(h.curBatchErrs, txresults...) // TODO, remove after issue 579

consensus/noops/noops.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func (i *Noops) RecvMsg(msg *pb.Message, senderHandle *pb.PeerID) error {
105105
return err
106106
}
107107
if logger.IsEnabledFor(logging.DEBUG) {
108-
logger.Debugf("Sending to channel tx uuid: %s", tx.Uuid)
108+
logger.Debugf("Sending to channel tx uuid: %s", tx.Txid)
109109
}
110110
i.channel <- tx
111111
}

consensus/pbft/batch.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,9 @@ func (op *obcBatch) execute(seqNo uint64, reqBatch *RequestBatch) {
192192
logger.Warningf("Batch replica %d could not unmarshal transaction %s", op.pbft.id, err)
193193
continue
194194
}
195-
logger.Debugf("Batch replica %d executing request with transaction %s from outstandingReqs, seqNo=%d", op.pbft.id, tx.Uuid, seqNo)
195+
logger.Debugf("Batch replica %d executing request with transaction %s from outstandingReqs, seqNo=%d", op.pbft.id, tx.Txid, seqNo)
196196
if outstanding, pending := op.reqStore.remove(req); !outstanding || !pending {
197-
logger.Debugf("Batch replica %d missing transaction %s outstanding=%v, pending=%v", op.pbft.id, tx.Uuid, outstanding, pending)
197+
logger.Debugf("Batch replica %d missing transaction %s outstanding=%v, pending=%v", op.pbft.id, tx.Txid, outstanding, pending)
198198
}
199199
txs = append(txs, tx)
200200
op.deduplicator.Execute(req)
@@ -314,7 +314,7 @@ func (op *obcBatch) logAddTxFromRequest(req *Request) {
314314
if err != nil {
315315
logger.Errorf("Replica %d was sent a transaction which did not unmarshal: %s", op.pbft.id, err)
316316
} else {
317-
logger.Debugf("Replica %d adding request from %d with transaction %s into outstandingReqs", op.pbft.id, req.ReplicaId, tx.Uuid)
317+
logger.Debugf("Replica %d adding request from %d with transaction %s into outstandingReqs", op.pbft.id, req.ReplicaId, tx.Txid)
318318
}
319319
}
320320
}

core/chaincode/chaincode_support.go

+15-15
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ func (chaincodeSupport *ChaincodeSupport) registerHandler(chaincodehandler *Hand
212212

213213
//now we are ready to receive messages and send back responses
214214
chaincodehandler.txCtxs = make(map[string]*transactionContext)
215-
chaincodehandler.uuidMap = make(map[string]bool)
215+
chaincodehandler.txidMap = make(map[string]bool)
216216
chaincodehandler.isTransaction = make(map[string]bool)
217217

218218
chaincodeLogger.Debugf("registered handler complete for chaincode %s", key)
@@ -243,7 +243,7 @@ func (chaincodeSupport *ChaincodeSupport) deregisterHandler(chaincodehandler *Ha
243243
}
244244

245245
// Based on state of chaincode send either init or ready to move to ready state
246-
func (chaincodeSupport *ChaincodeSupport) sendInitOrReady(context context.Context, uuid string, chaincode string, f *string, initArgs []string, timeout time.Duration, tx *pb.Transaction, depTx *pb.Transaction) error {
246+
func (chaincodeSupport *ChaincodeSupport) sendInitOrReady(context context.Context, txid string, chaincode string, f *string, initArgs []string, timeout time.Duration, tx *pb.Transaction, depTx *pb.Transaction) error {
247247
chaincodeSupport.runningChaincodes.Lock()
248248
//if its in the map, there must be a connected stream...nothing to do
249249
var chrte *chaincodeRTEnv
@@ -257,7 +257,7 @@ func (chaincodeSupport *ChaincodeSupport) sendInitOrReady(context context.Contex
257257

258258
var notfy chan *pb.ChaincodeMessage
259259
var err error
260-
if notfy, err = chrte.handler.initOrReady(uuid, f, initArgs, tx, depTx); err != nil {
260+
if notfy, err = chrte.handler.initOrReady(txid, f, initArgs, tx, depTx); err != nil {
261261
return fmt.Errorf("Error sending %s: %s", pb.ChaincodeMessage_INIT, err)
262262
}
263263
if notfy != nil {
@@ -272,7 +272,7 @@ func (chaincodeSupport *ChaincodeSupport) sendInitOrReady(context context.Contex
272272
}
273273

274274
//if initOrReady succeeded, our responsibility to delete the context
275-
chrte.handler.deleteTxContext(uuid)
275+
chrte.handler.deleteTxContext(txid)
276276

277277
return err
278278
}
@@ -309,7 +309,7 @@ func (chaincodeSupport *ChaincodeSupport) getArgsAndEnv(cID *pb.ChaincodeID, cLa
309309
}
310310

311311
// launchAndWaitForRegister will launch container if not already running. Use the targz to create the image if not found
312-
func (chaincodeSupport *ChaincodeSupport) launchAndWaitForRegister(ctxt context.Context, cds *pb.ChaincodeDeploymentSpec, cID *pb.ChaincodeID, uuid string, cLang pb.ChaincodeSpec_Type, targz io.Reader) (bool, error) {
312+
func (chaincodeSupport *ChaincodeSupport) launchAndWaitForRegister(ctxt context.Context, cds *pb.ChaincodeDeploymentSpec, cID *pb.ChaincodeID, txid string, cLang pb.ChaincodeSpec_Type, targz io.Reader) (bool, error) {
313313
chaincode := cID.Name
314314
if chaincode == "" {
315315
return false, fmt.Errorf("chaincode name not set")
@@ -359,10 +359,10 @@ func (chaincodeSupport *ChaincodeSupport) launchAndWaitForRegister(ctxt context.
359359
select {
360360
case ok := <-notfy:
361361
if !ok {
362-
err = fmt.Errorf("registration failed for %s(networkid:%s,peerid:%s,tx:%s)", chaincode, chaincodeSupport.peerNetworkID, chaincodeSupport.peerID, uuid)
362+
err = fmt.Errorf("registration failed for %s(networkid:%s,peerid:%s,tx:%s)", chaincode, chaincodeSupport.peerNetworkID, chaincodeSupport.peerID, txid)
363363
}
364364
case <-time.After(chaincodeSupport.ccStartupTimeout):
365-
err = fmt.Errorf("Timeout expired while starting chaincode %s(networkid:%s,peerid:%s,tx:%s)", chaincode, chaincodeSupport.peerNetworkID, chaincodeSupport.peerID, uuid)
365+
err = fmt.Errorf("Timeout expired while starting chaincode %s(networkid:%s,peerid:%s,tx:%s)", chaincode, chaincodeSupport.peerNetworkID, chaincodeSupport.peerID, txid)
366366
}
367367
if err != nil {
368368
chaincodeLogger.Debugf("stopping due to error while launching %s", err)
@@ -486,7 +486,7 @@ func (chaincodeSupport *ChaincodeSupport) Launch(context context.Context, t *pb.
486486
}
487487

488488
//hopefully we are restarting from existing image and the deployed transaction exists
489-
depTx, ledgerErr = ledger.GetTransactionByUUID(chaincode)
489+
depTx, ledgerErr = ledger.GetTransactionByID(chaincode)
490490
if ledgerErr != nil {
491491
return cID, cMsg, fmt.Errorf("Could not get deployment transaction for %s - %s", chaincode, ledgerErr)
492492
}
@@ -514,7 +514,7 @@ func (chaincodeSupport *ChaincodeSupport) Launch(context context.Context, t *pb.
514514
//launch container if it is a System container or not in dev mode
515515
if (!chaincodeSupport.userRunsCC || cds.ExecEnv == pb.ChaincodeDeploymentSpec_SYSTEM) && (chrte == nil || chrte.handler == nil) {
516516
var targz io.Reader = bytes.NewBuffer(cds.CodePackage)
517-
_, err = chaincodeSupport.launchAndWaitForRegister(context, cds, cID, t.Uuid, cLang, targz)
517+
_, err = chaincodeSupport.launchAndWaitForRegister(context, cds, cID, t.Txid, cLang, targz)
518518
if err != nil {
519519
chaincodeLogger.Errorf("launchAndWaitForRegister failed %s", err)
520520
return cID, cMsg, err
@@ -523,7 +523,7 @@ func (chaincodeSupport *ChaincodeSupport) Launch(context context.Context, t *pb.
523523

524524
if err == nil {
525525
//send init (if (f,args)) and wait for ready state
526-
err = chaincodeSupport.sendInitOrReady(context, t.Uuid, chaincode, f, initargs, chaincodeSupport.ccStartupTimeout, t, depTx)
526+
err = chaincodeSupport.sendInitOrReady(context, t.Txid, chaincode, f, initargs, chaincodeSupport.ccStartupTimeout, t, depTx)
527527
if err != nil {
528528
chaincodeLogger.Errorf("sending init failed(%s)", err)
529529
err = fmt.Errorf("Failed to init chaincode(%s)", err)
@@ -615,22 +615,22 @@ func (chaincodeSupport *ChaincodeSupport) Register(stream pb.ChaincodeSupport_Re
615615
}
616616

617617
// createTransactionMessage creates a transaction message.
618-
func createTransactionMessage(uuid string, cMsg *pb.ChaincodeInput) (*pb.ChaincodeMessage, error) {
618+
func createTransactionMessage(txid string, cMsg *pb.ChaincodeInput) (*pb.ChaincodeMessage, error) {
619619
payload, err := proto.Marshal(cMsg)
620620
if err != nil {
621621
fmt.Printf(err.Error())
622622
return nil, err
623623
}
624-
return &pb.ChaincodeMessage{Type: pb.ChaincodeMessage_TRANSACTION, Payload: payload, Uuid: uuid}, nil
624+
return &pb.ChaincodeMessage{Type: pb.ChaincodeMessage_TRANSACTION, Payload: payload, Txid: txid}, nil
625625
}
626626

627627
// createQueryMessage creates a query message.
628-
func createQueryMessage(uuid string, cMsg *pb.ChaincodeInput) (*pb.ChaincodeMessage, error) {
628+
func createQueryMessage(txid string, cMsg *pb.ChaincodeInput) (*pb.ChaincodeMessage, error) {
629629
payload, err := proto.Marshal(cMsg)
630630
if err != nil {
631631
return nil, err
632632
}
633-
return &pb.ChaincodeMessage{Type: pb.ChaincodeMessage_QUERY, Payload: payload, Uuid: uuid}, nil
633+
return &pb.ChaincodeMessage{Type: pb.ChaincodeMessage_QUERY, Payload: payload, Txid: txid}, nil
634634
}
635635

636636
// Execute executes a transaction and waits for it to complete until a timeout value.
@@ -660,7 +660,7 @@ func (chaincodeSupport *ChaincodeSupport) Execute(ctxt context.Context, chaincod
660660
}
661661

662662
//our responsibility to delete transaction context if sendExecuteMessage succeeded
663-
chrte.handler.deleteTxContext(msg.Uuid)
663+
chrte.handler.deleteTxContext(msg.Txid)
664664

665665
return ccresp, err
666666
}

core/chaincode/exectransaction.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ func Execute(ctxt context.Context, chain *ChaincodeSupport, t *pb.Transaction) (
8686

8787
var ccMsg *pb.ChaincodeMessage
8888
if t.Type == pb.Transaction_CHAINCODE_INVOKE {
89-
ccMsg, err = createTransactionMessage(t.Uuid, cMsg)
89+
ccMsg, err = createTransactionMessage(t.Txid, cMsg)
9090
if err != nil {
9191
return nil, nil, fmt.Errorf("Failed to transaction message(%s)", err)
9292
}
9393
} else {
94-
ccMsg, err = createQueryMessage(t.Uuid, cMsg)
94+
ccMsg, err = createQueryMessage(t.Txid, cMsg)
9595
if err != nil {
9696
return nil, nil, fmt.Errorf("Failed to query message(%s)", err)
9797
}
@@ -106,11 +106,11 @@ func Execute(ctxt context.Context, chain *ChaincodeSupport, t *pb.Transaction) (
106106
} else if resp == nil {
107107
// Rollback transaction
108108
markTxFinish(ledger, t, false)
109-
return nil, nil, fmt.Errorf("Failed to receive a response for (%s)", t.Uuid)
109+
return nil, nil, fmt.Errorf("Failed to receive a response for (%s)", t.Txid)
110110
} else {
111111
if resp.ChaincodeEvent != nil {
112112
resp.ChaincodeEvent.ChaincodeID = chaincode
113-
resp.ChaincodeEvent.TxID = t.Uuid
113+
resp.ChaincodeEvent.TxID = t.Txid
114114
}
115115

116116
if resp.Type == pb.ChaincodeMessage_COMPLETED || resp.Type == pb.ChaincodeMessage_QUERY_COMPLETED {
@@ -123,7 +123,7 @@ func Execute(ctxt context.Context, chain *ChaincodeSupport, t *pb.Transaction) (
123123
return nil, resp.ChaincodeEvent, fmt.Errorf("Transaction or query returned with failure: %s", string(resp.Payload))
124124
}
125125
markTxFinish(ledger, t, false)
126-
return resp.Payload, nil, fmt.Errorf("receive a response for (%s) but in invalid state(%d)", t.Uuid, resp.Type)
126+
return resp.Payload, nil, fmt.Errorf("receive a response for (%s) but in invalid state(%d)", t.Txid, resp.Type)
127127
}
128128

129129
} else {
@@ -184,9 +184,9 @@ func getTimeout(cID *pb.ChaincodeID) (time.Duration, error) {
184184
ledger, err := ledger.GetLedger()
185185
if err == nil {
186186
chaincodeID := cID.Name
187-
txUUID, err := ledger.GetState(chaincodeID, "github.com_openblockchain_obc-peer_chaincode_id", true)
187+
txID, err := ledger.GetState(chaincodeID, "github.com_openblockchain_obc-peer_chaincode_id", true)
188188
if err == nil {
189-
tx, err := ledger.GetTransactionByUUID(string(txUUID))
189+
tx, err := ledger.GetTransactionByID(string(txID))
190190
if err == nil {
191191
chaincodeDeploymentSpec := &pb.ChaincodeDeploymentSpec{}
192192
proto.Unmarshal(tx.Payload, chaincodeDeploymentSpec)
@@ -204,14 +204,14 @@ func markTxBegin(ledger *ledger.Ledger, t *pb.Transaction) {
204204
if t.Type == pb.Transaction_CHAINCODE_QUERY {
205205
return
206206
}
207-
ledger.TxBegin(t.Uuid)
207+
ledger.TxBegin(t.Txid)
208208
}
209209

210210
func markTxFinish(ledger *ledger.Ledger, t *pb.Transaction, successful bool) {
211211
if t.Type == pb.Transaction_CHAINCODE_QUERY {
212212
return
213213
}
214-
ledger.TxFinished(t.Uuid, successful)
214+
ledger.TxFinished(t.Txid, successful)
215215
}
216216

217217
func sendTxRejectedEvent(tx *pb.Transaction, errorMsg string) {

0 commit comments

Comments
 (0)