From 6a2408b2095ef5eb90f03d4f5a47e721b22d2882 Mon Sep 17 00:00:00 2001 From: Chris Elder Date: Wed, 8 Feb 2017 15:11:02 -0500 Subject: [PATCH] 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 --- core/ledger/util/couchdb/couchdb.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/core/ledger/util/couchdb/couchdb.go b/core/ledger/util/couchdb/couchdb.go index ec17f3f04c8..5edd1fba3a4 100644 --- a/core/ledger/util/couchdb/couchdb.go +++ b/core/ledger/util/couchdb/couchdb.go @@ -35,7 +35,6 @@ import ( "strings" "unicode/utf8" - "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/version" logging "github.com/op/go-logging" ) @@ -104,9 +103,8 @@ type DocID struct { //QueryResult is used for returning query results from CouchDB type QueryResult struct { - ID string - Version *version.Height - Value []byte + ID string + Value []byte } //CouchConnectionDef contains parameters @@ -713,7 +711,7 @@ func (dbclient *CouchDatabase) ReadDocRange(startKey, endKey string, limit, skip return nil, err } - var addDocument = &QueryResult{jsonDoc.ID, version.NewHeight(1, 1), binaryDocument} + var addDocument = &QueryResult{jsonDoc.ID, binaryDocument} results = append(results, *addDocument) @@ -721,7 +719,7 @@ func (dbclient *CouchDatabase) ReadDocRange(startKey, endKey string, limit, skip logger.Debugf("Adding json docment for id: %s", jsonDoc.ID) - var addDocument = &QueryResult{jsonDoc.ID, version.NewHeight(1, 1), row.Doc} + var addDocument = &QueryResult{jsonDoc.ID, row.Doc} results = append(results, *addDocument) @@ -799,7 +797,7 @@ func (dbclient *CouchDatabase) QueryDocuments(query string, limit, skip int) (*[ logger.Debugf("Adding row to resultset: %s", row) //TODO Replace the temporary NewHeight version when available - var addDocument = &QueryResult{jsonDoc.ID, version.NewHeight(1, 1), row} + var addDocument = &QueryResult{jsonDoc.ID, row} results = append(results, *addDocument)