fabric: github.com/hyperledger/fabric/common/mocks/config Index | Files

package config

import "github.com/hyperledger/fabric/common/mocks/config"

Index

Package Files

application.go channel.go orderer.go resources.go

type Channel Uses

type Channel struct {
    // HashingAlgorithmVal is returned as the result of HashingAlgorithm() if set
    HashingAlgorithmVal func([]byte) []byte
    // BlockDataHashingStructureWidthVal is returned as the result of BlockDataHashingStructureWidth()
    BlockDataHashingStructureWidthVal uint32
    // OrdererAddressesVal is returned as the result of OrdererAddresses()
    OrdererAddressesVal []string
    // CapabilitiesVal is returned as the result of Capabilities()
    CapabilitiesVal channelconfig.ChannelCapabilities
}

Channel is a mock implementation of config.Channel

func (*Channel) BlockDataHashingStructureWidth Uses

func (scm *Channel) BlockDataHashingStructureWidth() uint32

BlockDataHashingStructureWidth returns the BlockDataHashingStructureWidthVal

func (*Channel) Capabilities Uses

func (scm *Channel) Capabilities() channelconfig.ChannelCapabilities

Capabilities returns CapabilitiesVal

func (*Channel) HashingAlgorithm Uses

func (scm *Channel) HashingAlgorithm() func([]byte) []byte

HashingAlgorithm returns the HashingAlgorithmVal if set, otherwise a fake simple hash function

func (*Channel) OrdererAddresses Uses

func (scm *Channel) OrdererAddresses() []string

OrdererAddresses returns the OrdererAddressesVal

type ChannelCapabilities Uses

type ChannelCapabilities struct {
    // SupportedErr is returned by Supported()
    SupportedErr error

    // MSPVersionVal is returned by MSPVersion()
    MSPVersionVal msp.MSPVersion

    ConsensusTypeMigrationVal bool
}

ChannelCapabilities mocks the channelconfig.ChannelCapabilities interface

func (*ChannelCapabilities) ConsensusTypeMigration Uses

func (cc *ChannelCapabilities) ConsensusTypeMigration() bool

ConsensusTypeMigration returns ConsensusTypeMigrationVal

func (*ChannelCapabilities) MSPVersion Uses

func (cc *ChannelCapabilities) MSPVersion() msp.MSPVersion

MSPVersion returns MSPVersionVal

func (*ChannelCapabilities) OrgSpecificOrdererEndpoints Uses

func (cc *ChannelCapabilities) OrgSpecificOrdererEndpoints() bool

func (*ChannelCapabilities) Supported Uses

func (cc *ChannelCapabilities) Supported() error

Supported returns SupportedErr

type MockApplication Uses

type MockApplication struct {
    CapabilitiesRv channelconfig.ApplicationCapabilities
    Acls           map[string]string
}

func (*MockApplication) APIPolicyMapper Uses

func (m *MockApplication) APIPolicyMapper() channelconfig.PolicyMapper

Returns the mock which itself is a provider

func (*MockApplication) Capabilities Uses

func (m *MockApplication) Capabilities() channelconfig.ApplicationCapabilities

func (*MockApplication) Organizations Uses

func (m *MockApplication) Organizations() map[string]channelconfig.ApplicationOrg

func (*MockApplication) PolicyRefForAPI Uses

func (m *MockApplication) PolicyRefForAPI(apiName string) string

type MockApplicationCapabilities Uses

type MockApplicationCapabilities struct {
    SupportedRv                  error
    ForbidDuplicateTXIdInBlockRv bool
    ACLsRv                       bool
    PrivateChannelDataRv         bool
    CollectionUpgradeRv          bool
    V1_1ValidationRv             bool
    V1_2ValidationRv             bool
    MetadataLifecycleRv          bool
    KeyLevelEndorsementRv        bool
    V1_3ValidationRv             bool
    FabTokenRv                   bool
    StorePvtDataOfInvalidTxRv    bool
}

func (*MockApplicationCapabilities) ACLs Uses

func (mac *MockApplicationCapabilities) ACLs() bool

func (*MockApplicationCapabilities) CollectionUpgrade Uses

func (mac *MockApplicationCapabilities) CollectionUpgrade() bool

func (*MockApplicationCapabilities) FabToken Uses

func (mac *MockApplicationCapabilities) FabToken() bool

func (*MockApplicationCapabilities) ForbidDuplicateTXIdInBlock Uses

func (mac *MockApplicationCapabilities) ForbidDuplicateTXIdInBlock() bool

func (*MockApplicationCapabilities) KeyLevelEndorsement Uses

func (mac *MockApplicationCapabilities) KeyLevelEndorsement() bool

func (*MockApplicationCapabilities) MetadataLifecycle Uses

func (mac *MockApplicationCapabilities) MetadataLifecycle() bool

func (*MockApplicationCapabilities) PrivateChannelData Uses

func (mac *MockApplicationCapabilities) PrivateChannelData() bool

func (*MockApplicationCapabilities) StorePvtDataOfInvalidTx Uses

func (mac *MockApplicationCapabilities) StorePvtDataOfInvalidTx() bool

func (*MockApplicationCapabilities) Supported Uses

func (mac *MockApplicationCapabilities) Supported() error

func (*MockApplicationCapabilities) V1_1Validation Uses

func (mac *MockApplicationCapabilities) V1_1Validation() bool

func (*MockApplicationCapabilities) V1_2Validation Uses

func (mac *MockApplicationCapabilities) V1_2Validation() bool

func (*MockApplicationCapabilities) V1_3Validation Uses

func (mac *MockApplicationCapabilities) V1_3Validation() bool

type Orderer Uses

type Orderer struct {
    // ConsensusTypeVal is returned as the result of ConsensusType()
    ConsensusTypeVal string
    // ConsensusMetadataVal is returned as the result of ConsensusMetadata()
    ConsensusMetadataVal []byte
    // ConsensusTypeStateVal is returned as the result of ConsensusState()
    ConsensusTypeStateVal ab.ConsensusType_State

    // BatchSizeVal is returned as the result of BatchSize()
    BatchSizeVal *ab.BatchSize
    // BatchTimeoutVal is returned as the result of BatchTimeout()
    BatchTimeoutVal time.Duration
    // KafkaBrokersVal is returned as the result of KafkaBrokers()
    KafkaBrokersVal []string
    // MaxChannelsCountVal is returns as the result of MaxChannelsCount()
    MaxChannelsCountVal uint64
    // OrganizationsVal is returned as the result of Organizations()
    OrganizationsVal map[string]channelconfig.OrdererOrg
    // CapabilitiesVal is returned as the result of Capabilities()
    CapabilitiesVal channelconfig.OrdererCapabilities
}

Orderer is a mock implementation of channelconfig.Orderer

func (*Orderer) BatchSize Uses

func (o *Orderer) BatchSize() *ab.BatchSize

BatchSize returns the BatchSizeVal

func (*Orderer) BatchTimeout Uses

func (o *Orderer) BatchTimeout() time.Duration

BatchTimeout returns the BatchTimeoutVal

func (*Orderer) Capabilities Uses

func (o *Orderer) Capabilities() channelconfig.OrdererCapabilities

Capabilities returns CapabilitiesVal

func (*Orderer) ConsensusMetadata Uses

func (o *Orderer) ConsensusMetadata() []byte

ConsensusMetadata returns the ConsensusMetadataVal

func (*Orderer) ConsensusState Uses

func (o *Orderer) ConsensusState() ab.ConsensusType_State

ConsensusState returns the ConsensusTypeStateVal

func (*Orderer) ConsensusType Uses

func (o *Orderer) ConsensusType() string

ConsensusType returns the ConsensusTypeVal

func (*Orderer) KafkaBrokers Uses

func (o *Orderer) KafkaBrokers() []string

KafkaBrokers returns the KafkaBrokersVal

func (*Orderer) MaxChannelsCount Uses

func (o *Orderer) MaxChannelsCount() uint64

MaxChannelsCount returns the MaxChannelsCountVal

func (*Orderer) Organizations Uses

func (o *Orderer) Organizations() map[string]channelconfig.OrdererOrg

Organizations returns OrganizationsVal

type OrdererCapabilities Uses

type OrdererCapabilities struct {
    // SupportedErr is returned by Supported()
    SupportedErr error

    // PredictableChannelTemplateVal is returned by PredictableChannelTemplate()
    PredictableChannelTemplateVal bool

    // ResubmissionVal is returned by Resubmission()
    ResubmissionVal bool

    // ExpirationVal is returned by ExpirationCheck()
    ExpirationVal bool

    ConsensusTypeMigrationVal bool
}

OrdererCapabilities mocks the channelconfig.OrdererCapabilities interface

func (*OrdererCapabilities) ConsensusTypeMigration Uses

func (oc *OrdererCapabilities) ConsensusTypeMigration() bool

ConsensusTypeMigration checks whether the orderer permits a consensus-type migration.

func (*OrdererCapabilities) ExpirationCheck Uses

func (oc *OrdererCapabilities) ExpirationCheck() bool

ExpirationCheck specifies whether the orderer checks for identity expiration checks when validating messages

func (*OrdererCapabilities) PredictableChannelTemplate Uses

func (oc *OrdererCapabilities) PredictableChannelTemplate() bool

PredictableChannelTemplate returns PredictableChannelTemplateVal

func (*OrdererCapabilities) Resubmission Uses

func (oc *OrdererCapabilities) Resubmission() bool

Resubmission returns ResubmissionVal

func (*OrdererCapabilities) Supported Uses

func (oc *OrdererCapabilities) Supported() error

Supported returns SupportedErr

type Resources Uses

type Resources struct {
    // ConfigtxValidatorVal is returned as the result of ConfigtxValidator
    ConfigtxValidatorVal configtx.Validator

    // PolicyManagerVal is returned as the result of PolicyManager()
    PolicyManagerVal policies.Manager

    // ChannelConfigVal is returned as the result of ChannelConfig()
    ChannelConfigVal channelconfig.Channel

    // OrdererConfigVal is returned as the result of OrdererConfig()
    OrdererConfigVal channelconfig.Orderer

    // ApplicationConfigVal is returned as the result of ApplicationConfig()
    ApplicationConfigVal channelconfig.Application

    // ConsortiumsConfigVal is returned as the result of ConsortiumsConfig()
    ConsortiumsConfigVal channelconfig.Consortiums

    // MSPManagerVal is returned as the result of MSPManager()
    MSPManagerVal msp.MSPManager

    // ValidateNewErr is returned as the result of ValidateNew
    ValidateNewErr error
}

func (*Resources) ApplicationConfig Uses

func (r *Resources) ApplicationConfig() (channelconfig.Application, bool)

Returns the ApplicationConfigVal

func (*Resources) ChannelConfig Uses

func (r *Resources) ChannelConfig() channelconfig.Channel

Returns the ChannelConfigVal

func (*Resources) ConfigtxValidator Uses

func (r *Resources) ConfigtxValidator() configtx.Validator

ConfigtxMangaer returns ConfigtxValidatorVal

func (*Resources) ConsortiumsConfig Uses

func (r *Resources) ConsortiumsConfig() (channelconfig.Consortiums, bool)

func (*Resources) MSPManager Uses

func (r *Resources) MSPManager() msp.MSPManager

Returns the MSPManagerVal

func (*Resources) OrdererConfig Uses

func (r *Resources) OrdererConfig() (channelconfig.Orderer, bool)

Returns the OrdererConfigVal

func (*Resources) PolicyManager Uses

func (r *Resources) PolicyManager() policies.Manager

Returns the PolicyManagerVal

func (*Resources) ValidateNew Uses

func (r *Resources) ValidateNew(res channelconfig.Resources) error

ValidateNew returns ValidateNewErr

Package config imports 7 packages (graph) and is imported by 4 packages. Updated 2019-07-31. Refresh now. Tools for package owners.