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

     1  /*
     2  Copyright hechain. All Rights Reserved.
     3  
     4  SPDX-License-Identifier: Apache-2.0
     5  */
     6  
     7  package validation
     8  
     9  import validation "github.com/hechain20/hechain/core/handlers/validation/api"
    10  
    11  // Capabilities defines what capabilities the validation
    12  // should take into account when validating a transaction
    13  type Capabilities interface {
    14  	validation.Dependency
    15  	// Supported returns an error if there are unknown capabilities in this channel which are required
    16  	Supported() error
    17  
    18  	// ForbidDuplicateTXIdInBlock specifies whether two transactions with the same TXId are permitted
    19  	// in the same block or whether we mark the second one as TxValidationCode_DUPLICATE_TXID
    20  	ForbidDuplicateTXIdInBlock() bool
    21  
    22  	// ACLs returns true if the peer supports ACLs in the channel config
    23  	ACLs() bool
    24  
    25  	// PrivateChannelData returns true if support for private channel data (a.k.a. collections) is enabled.
    26  	PrivateChannelData() bool
    27  
    28  	// CollectionUpgrade returns true if this channel is configured to allow updates to
    29  	// existing collection or add new collections through chaincode upgrade (as introduced in v1.2)
    30  	CollectionUpgrade() bool
    31  
    32  	// V1_1Validation returns true is this channel is configured to perform stricter validation
    33  	// of transactions (as introduced in v1.1).
    34  	V1_1Validation() bool
    35  
    36  	// V1_2Validation returns true is this channel is configured to perform stricter validation
    37  	// of transactions (as introduced in v1.2).
    38  	V1_2Validation() bool
    39  
    40  	// V1_3Validation returns true if this channel supports transaction validation
    41  	// as introduced in v1.3. This includes:
    42  	//  - policies expressible at a ledger key granularity, as described in FAB-8812
    43  	//  - new chaincode lifecycle, as described in FAB-11237
    44  	V1_3Validation() bool
    45  
    46  	// StorePvtDataOfInvalidTx returns true if the peer needs to store
    47  	// the pvtData of invalid transactions (as introduced in v142).
    48  	StorePvtDataOfInvalidTx() bool
    49  
    50  	// V2_0Validation returns true if this channel supports transaction validation
    51  	// as introduced in v2.0. This includes:
    52  	//  - new chaincode lifecycle
    53  	//  - implicit per-org collections
    54  	V2_0Validation() bool
    55  
    56  	// MetadataLifecycle is an obsolete capability but left so as not to break the interface
    57  	MetadataLifecycle() bool
    58  
    59  	// KeyLevelEndorsement returns true if this channel supports endorsement
    60  	// policies expressible at a ledger key granularity, as described in FAB-8812
    61  	KeyLevelEndorsement() bool
    62  }