configtx

package
v0.0.0-...-94b13b5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

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) ChainID

func (cm *Manager) ChainID() string

ConsensusType returns the ConsensusTypeVal

func (*Manager) ConfigEnvelope

func (cm *Manager) ConfigEnvelope() *cb.ConfigEnvelope

ConfigEnvelope returns the ConfigEnvelopeVal

func (*Manager) ProposeConfigUpdate

func (cm *Manager) ProposeConfigUpdate(update *cb.Envelope) (*cb.ConfigEnvelope, error)

ProposeConfigUpdate

func (*Manager) Sequence

func (cm *Manager) Sequence() uint64

BatchSize returns the BatchSizeVal

func (*Manager) Validate

func (cm *Manager) Validate(configEnv *cb.ConfigEnvelope) error

Validate returns ValidateVal

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

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

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

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

Returns the OrdererConfigVal

func (*Resources) PolicyManager

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

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

func (*ValueProposer) Deserialize

func (vp *ValueProposer) Deserialize(key string, value []byte) (proto.Message, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL