Documentation ¶
Index ¶
- type Initializer
- type Manager
- func (cm *Manager) Apply(configEnv *cb.ConfigEnvelope) error
- func (cm *Manager) ChainID() string
- func (cm *Manager) ConfigEnvelope() *cb.ConfigEnvelope
- func (cm *Manager) ProposeConfigUpdate(update *cb.Envelope) (*cb.ConfigEnvelope, error)
- func (cm *Manager) Sequence() uint64
- func (cm *Manager) Validate(configEnv *cb.ConfigEnvelope) error
- type PolicyProposer
- type Resources
- func (r *Resources) ApplicationConfig() (config.Application, bool)
- func (r *Resources) ChannelConfig() config.Channel
- func (r *Resources) ConsortiumsConfig() (config.Consortiums, bool)
- func (r *Resources) MSPManager() msp.MSPManager
- func (r *Resources) OrdererConfig() (config.Orderer, bool)
- func (r *Resources) PolicyManager() policies.Manager
- type Transactional
- type ValueProposer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Initializer ¶
type Initializer struct { Resources // PolicyProposerVal is returned by PolicyProposers PolicyProposerVal *PolicyProposer // ValueProposerVal is returned by ValueProposers ValueProposerVal *ValueProposer }
Initializer mocks the configtxapi.Initializer interface
func (*Initializer) PolicyProposer ¶
func (i *Initializer) PolicyProposer() policies.Proposer
PolicyProposers returns PolicyProposerVal
func (*Initializer) ValueProposer ¶
func (i *Initializer) ValueProposer() config.ValueProposer
ValueProposers returns ValueProposerVal
type Manager ¶
type Manager struct { Initializer // ChainIDVal is returned as the result of ChainID() ChainIDVal string // SequenceVal is returned as the result of Sequence() SequenceVal uint64 // ApplyVal is returned by Apply ApplyVal error // AppliedConfigUpdateEnvelope is set by Apply AppliedConfigUpdateEnvelope *cb.ConfigEnvelope // ValidateVal is returned by Validate ValidateVal error // ProposeConfigUpdateError is returned as the error value for ProposeConfigUpdate ProposeConfigUpdateError error // ProposeConfigUpdateVal is returns as the value for ProposeConfigUpdate ProposeConfigUpdateVal *cb.ConfigEnvelope // ConfigEnvelopeVal is returned as the value for ConfigEnvelope() ConfigEnvelopeVal *cb.ConfigEnvelope }
Manager is a mock implementation of configtxapi.Manager
func (*Manager) Apply ¶
func (cm *Manager) Apply(configEnv *cb.ConfigEnvelope) error
Apply returns ApplyVal
func (*Manager) ConfigEnvelope ¶
func (cm *Manager) ConfigEnvelope() *cb.ConfigEnvelope
ConfigEnvelope returns the ConfigEnvelopeVal
func (*Manager) ProposeConfigUpdate ¶
ProposeConfigUpdate
type PolicyProposer ¶
type PolicyProposer struct { Transactional LastKey string LastPolicy *cb.ConfigPolicy ErrorForProposePolicy error }
PolicyProposer mocks the policies.Proposer interface
func (*PolicyProposer) BeginPolicyProposals ¶
func (pp *PolicyProposer) BeginPolicyProposals(tx interface{}, groups []string) ([]policies.Proposer, error)
BeginConfig will be removed in the future
func (*PolicyProposer) ProposePolicy ¶
func (pp *PolicyProposer) ProposePolicy(tx interface{}, key string, configPolicy *cb.ConfigPolicy) (proto.Message, error)
ProposeConfig sets LastKey to key, LastPath to path, and LastPolicy to configPolicy, returning ErrorForProposedConfig
type Resources ¶
type Resources struct { // PolicyManagerVal is returned as the result of PolicyManager() PolicyManagerVal *mockpolicies.Manager // ChannelConfigVal is returned as the result of ChannelConfig() ChannelConfigVal config.Channel // OrdererConfigVal is returned as the result of OrdererConfig() OrdererConfigVal config.Orderer // ApplicationConfigVal is returned as the result of ApplicationConfig() ApplicationConfigVal config.Application // ConsortiumsConfigVal is returned as the result of ConsortiumsConfig() ConsortiumsConfigVal config.Consortiums // MSPManagerVal is returned as the result of MSPManager() MSPManagerVal msp.MSPManager }
func (*Resources) ApplicationConfig ¶
func (r *Resources) ApplicationConfig() (config.Application, bool)
Returns the ApplicationConfigVal
func (*Resources) ChannelConfig ¶
Returns the ChannelConfigVal
func (*Resources) ConsortiumsConfig ¶
func (r *Resources) ConsortiumsConfig() (config.Consortiums, bool)
func (*Resources) MSPManager ¶
func (r *Resources) MSPManager() msp.MSPManager
Returns the MSPManagerVal
func (*Resources) OrdererConfig ¶
Returns the OrdererConfigVal
func (*Resources) PolicyManager ¶
Returns the PolicyManagerVal
type Transactional ¶
type Transactional struct{}
Transactional implements the configtxapi.Transactional
func (*Transactional) CommitProposals ¶
func (t *Transactional) CommitProposals(tx interface{})
CommitConfig does nothing
func (*Transactional) PreCommit ¶
func (t *Transactional) PreCommit(tx interface{}) error
PreCommit returns nil
func (*Transactional) RollbackProposals ¶
func (t *Transactional) RollbackProposals(tx interface{})
RollbackConfig does nothing
type ValueProposer ¶
type ValueProposer struct { Transactional LastKey string LastValue *cb.ConfigValue ErrorForProposeConfig error DeserializeReturn proto.Message DeserializeError error }
Handler mocks the configtxapi.Handler interface
func (*ValueProposer) BeginValueProposals ¶
func (vp *ValueProposer) BeginValueProposals(tx interface{}, groups []string) (config.ValueDeserializer, []config.ValueProposer, error)
BeginConfig returns slices populated by self