github.com/hechain20/hechain@v0.0.0-20220316014945-b544036ba106/core/handlers/endorsement/api/state/state.go (about)

     1  /*
     2  Copyright hechain. All Rights Reserved.
     3  
     4  SPDX-License-Identifier: Apache-2.0
     5  */
     6  
     7  package endorsement
     8  
     9  import (
    10  	endorsement "github.com/hechain20/hechain/core/handlers/endorsement/api"
    11  	"github.com/hyperledger/fabric-protos-go/ledger/rwset"
    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  }