Skip to content

Commit 7db3451

Browse files
committed
Fix typo
As currently txId not use uuid, fix some typo to be consistent. Also fix some comments. Change-Id: Id6fb88aed3da7409f834ea38f5f485cc1f194092 Signed-off-by: grapebaba <[email protected]>
1 parent adc3c56 commit 7db3451

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

core/ledger/statemgmt/state/state.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ func (state *State) TxBegin(txID string) {
8989

9090
// TxFinish marks the completion of on-going tx. If txID is not same as of the on-going tx, this call panics
9191
func (state *State) TxFinish(txID string, txSuccessful bool) {
92-
logger.Debugf("txFinish() for txUuid [%s], txSuccessful=[%t]", txID, txSuccessful)
92+
logger.Debugf("txFinish() for txId [%s], txSuccessful=[%t]", txID, txSuccessful)
9393
if state.currentTxID != txID {
94-
panic(fmt.Errorf("Different Uuid in tx-begin [%s] and tx-finish [%s]", state.currentTxID, txID))
94+
panic(fmt.Errorf("Different txId in tx-begin [%s] and tx-finish [%s]", state.currentTxID, txID))
9595
}
9696
if txSuccessful {
9797
if !state.currentTxStateDelta.IsEmpty() {
98-
logger.Debugf("txFinish() for txUuid [%s] merging state changes", txID)
98+
logger.Debugf("txFinish() for txId [%s] merging state changes", txID)
9999
state.stateDelta.ApplyChanges(state.currentTxStateDelta)
100100
state.txStateDeltaHash[txID] = state.currentTxStateDelta.ComputeCryptoHash()
101101
state.updateStateImpl = true
@@ -144,7 +144,7 @@ func (state *State) GetRangeScanIterator(chaincodeID string, startKey string, en
144144
stateImplItr), nil
145145
}
146146

147-
// Set sets state to given value for chaincodeID and key. Does not immideatly writes to DB
147+
// Set sets state to given value for chaincodeID and key. Does not immediately writes to DB
148148
func (state *State) Set(chaincodeID string, key string, value []byte) error {
149149
logger.Debugf("set() chaincodeID=[%s], key=[%s], value=[%#v]", chaincodeID, key, value)
150150
if !state.txInProgress() {
@@ -168,7 +168,7 @@ func (state *State) Set(chaincodeID string, key string, value []byte) error {
168168
return nil
169169
}
170170

171-
// Delete tracks the deletion of state for chaincodeID and key. Does not immideatly writes to DB
171+
// Delete tracks the deletion of state for chaincodeID and key. Does not immediately writes to DB
172172
func (state *State) Delete(chaincodeID string, key string) error {
173173
logger.Debugf("delete() chaincodeID=[%s], key=[%s]", chaincodeID, key)
174174
if !state.txInProgress() {

core/ledger/statemgmt/state_delta.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ func (chaincodeStateDelta *ChaincodeStateDelta) set(key string, updatedValue, pr
197197
func (chaincodeStateDelta *ChaincodeStateDelta) remove(key string, previousValue []byte) {
198198
updatedKV, ok := chaincodeStateDelta.UpdatedKVs[key]
199199
if ok {
200-
// Key already exists, just set the previous value
200+
// Key already exists, just set the value
201201
updatedKV.Value = nil
202202
} else {
203203
// New key. Create a new entry in the map

0 commit comments

Comments
 (0)