github.com/kaituanwang/hyperledger@v2.0.1+incompatible/core/handlers/endorsement/api/state/state.go (about)

     1  /*
     2  Copyright IBM Corp. All Rights Reserved.
     3  
     4  SPDX-License-Identifier: Apache-2.0
     5  */
     6  
     7  package endorsement
     8  
     9  import (
    10  	"github.com/hyperledger/fabric-protos-go/ledger/rwset"
    11  	endorsement "github.com/hyperledger/fabric/core/handlers/endorsement/api"
    12  )
    13  
    14  // State defines interaction with the world state
    15  type State interface {
    16  	// GetPrivateDataMultipleKeys gets the values for the multiple private data items in a single call
    17  	GetPrivateDataMultipleKeys(namespace, collection string, keys []string) ([][]byte, error)
    18  
    19  	// GetStateMultipleKeys gets the values for multiple keys in a single call
    20  	GetStateMultipleKeys(namespace string, keys []string) ([][]byte, error)
    21  
    22  	// GetTransientByTXID gets the values private data associated with the given txID
    23  	GetTransientByTXID(txID string) ([]*rwset.TxPvtReadWriteSet, error)
    24  
    25  	// Done releases resources occupied by the State
    26  	Done()
    27  }
    28  
    29  // StateFetcher retrieves an instance of a state
    30  type StateFetcher interface {
    31  	endorsement.Dependency
    32  
    33  	// FetchState fetches state
    34  	FetchState() (State, error)
    35  }