Skip to content

Commit 6a2408b

Browse files
author
Chris Elder
committed
FAB-2015 Remove Version from CouchDB QueryResult
Motivation for this change: Version is no longer required in the QueryResult structure. This also keeps the CouchDB layer to be more generic, since the CouchDB data layer is used by consumers other than Ledger. - Remove Version from QueryResult struct in couchdb.go - Previous changes in FAB1818 remove any reference to Version - Remove 3 instances where Version is populated with development values Change-Id: I9ac47e96b9530e23f6a31a075e71ba811e13cf05 Signed-off-by: Chris Elder <[email protected]>
1 parent f7c19f8 commit 6a2408b

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

core/ledger/util/couchdb/couchdb.go

+5-7
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import (
3535
"strings"
3636
"unicode/utf8"
3737

38-
"github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/version"
3938
logging "github.com/op/go-logging"
4039
)
4140

@@ -104,9 +103,8 @@ type DocID struct {
104103

105104
//QueryResult is used for returning query results from CouchDB
106105
type QueryResult struct {
107-
ID string
108-
Version *version.Height
109-
Value []byte
106+
ID string
107+
Value []byte
110108
}
111109

112110
//CouchConnectionDef contains parameters
@@ -713,15 +711,15 @@ func (dbclient *CouchDatabase) ReadDocRange(startKey, endKey string, limit, skip
713711
return nil, err
714712
}
715713

716-
var addDocument = &QueryResult{jsonDoc.ID, version.NewHeight(1, 1), binaryDocument}
714+
var addDocument = &QueryResult{jsonDoc.ID, binaryDocument}
717715

718716
results = append(results, *addDocument)
719717

720718
} else {
721719

722720
logger.Debugf("Adding json docment for id: %s", jsonDoc.ID)
723721

724-
var addDocument = &QueryResult{jsonDoc.ID, version.NewHeight(1, 1), row.Doc}
722+
var addDocument = &QueryResult{jsonDoc.ID, row.Doc}
725723

726724
results = append(results, *addDocument)
727725

@@ -799,7 +797,7 @@ func (dbclient *CouchDatabase) QueryDocuments(query string, limit, skip int) (*[
799797
logger.Debugf("Adding row to resultset: %s", row)
800798

801799
//TODO Replace the temporary NewHeight version when available
802-
var addDocument = &QueryResult{jsonDoc.ID, version.NewHeight(1, 1), row}
800+
var addDocument = &QueryResult{jsonDoc.ID, row}
803801

804802
results = append(results, *addDocument)
805803

0 commit comments

Comments
 (0)