Skip to content
  • Chris Elder's avatar
    FAB-1818 Create data wrapper for state data in CouchDB · ead6705d
    Chris Elder authored
    
    
    Motivation for this change:
    Maintain the version inline with the document, without changing the
    structure/value of the stored document.  This will prevent unexpected
    data values being returned and will prevent possible name collisions
    with document values.
    
    - Create a data wrapper for ledger JSON data stored in CouchDB.
    
    - Return the version based on block number and transaction id
    
    The wrapper will be implemented as a new key named "data" which will
    contain the JSON data for the state database.
    
    Prior to change example:
    
    "doc": {
     "_id": "2",
     "_rev": "2-8ee0c31b21ad650e5b872c0b98e59ab5",
     "version":"1:2"
     "asset_name": "marble2",
     "color": "red",
     "owner": "tom",
     "size": "25"
    }
    
     Following change:
    
     "doc": {
      "_id": "2",
      "_rev": "2-8ee0c31b21ad650e5b872c0b98e59ab5",
      "version":"1:2"
      "data": {
       "asset_name": "marble2",
       "color": "red",
       "owner": "tom",
       "size": "25"
      }
     }
    
    Change-Id: I59391ea926531c46c346fc8448e3d041ca5f3fdf
    Signed-off-by: default avatarChris Elder <chris.elder@us.ibm.com>
    ead6705d