Documentation ¶
Index ¶
- type ConsenterSupport
- func (mcs *ConsenterSupport) Append(block *cb.Block) error
- func (mcs *ConsenterSupport) Block(number uint64) *cb.Block
- func (mcs *ConsenterSupport) BlockCutter() blockcutter.Receiver
- func (mcs *ConsenterSupport) ChannelConfig() channelconfig.Channel
- func (mcs *ConsenterSupport) ChannelID() string
- func (mcs *ConsenterSupport) ClassifyMsg(chdr *cb.ChannelHeader) msgprocessor.Classification
- func (mcs *ConsenterSupport) CreateNextBlock(data []*cb.Envelope) *cb.Block
- func (mcs *ConsenterSupport) Height() uint64
- func (mcs *ConsenterSupport) NewSignatureHeader() (*cb.SignatureHeader, error)
- func (mcs *ConsenterSupport) ProcessConfigMsg(env *cb.Envelope) (*cb.Envelope, uint64, error)
- func (mcs *ConsenterSupport) ProcessConfigUpdateMsg(env *cb.Envelope) (config *cb.Envelope, configSeq uint64, err error)
- func (mcs *ConsenterSupport) ProcessNormalMsg(env *cb.Envelope) (configSeq uint64, err error)
- func (mcs *ConsenterSupport) Sequence() uint64
- func (mcs *ConsenterSupport) Serialize() ([]byte, error)
- func (mcs *ConsenterSupport) SharedConfig() channelconfig.Orderer
- func (mcs *ConsenterSupport) Sign(message []byte) ([]byte, error)
- func (mcs *ConsenterSupport) VerifyBlockSignature(_ []*protoutil.SignedData, _ *cb.ConfigEnvelope) error
- func (mcs *ConsenterSupport) WriteBlock(block *cb.Block, encodedMetadataValue []byte)
- func (mcs *ConsenterSupport) WriteConfigBlock(block *cb.Block, encodedMetadataValue []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsenterSupport ¶
type ConsenterSupport struct { channelconfig.Orderer // ChannelConfigVal is the value returned by ChannelConfig() ChannelConfigVal channelconfig.Channel // BlockCutterVal is the value returned by BlockCutter() BlockCutterVal *mockblockcutter.Receiver // BlockByIndex maps block numbers to retrieved values of these blocks BlockByIndex map[uint64]*cb.Block // Blocks is the channel where WriteBlock writes the most recently created block, Blocks chan *cb.Block // ChannelIDVal is the value returned by ChannelID() ChannelIDVal string // HeightVal is the value returned by Height() HeightVal uint64 // NextBlockVal stores the block created by the most recent CreateNextBlock() call NextBlockVal *cb.Block // ClassifyMsgVal is returned by ClassifyMsg ClassifyMsgVal msgprocessor.Classification // ConfigSeqVal is returned as the configSeq for Process*Msg ConfigSeqVal uint64 // ProcessNormalMsgErr is returned as the error for ProcessNormalMsg ProcessNormalMsgErr error // ProcessConfigUpdateMsgVal is returned as the error for ProcessConfigUpdateMsg ProcessConfigUpdateMsgVal *cb.Envelope // ProcessConfigUpdateMsgErr is returned as the error for ProcessConfigUpdateMsg ProcessConfigUpdateMsgErr error // ProcessConfigMsgVal is returned as the error for ProcessConfigMsg ProcessConfigMsgVal *cb.Envelope // ProcessConfigMsgErr is returned by ProcessConfigMsg ProcessConfigMsgErr error // SequenceVal is returned by Sequence SequenceVal uint64 // BlockVerificationErr is returned by VerifyBlockSignature BlockVerificationErr error }SharedConfigVal
ConsenterSupport is used to mock the multichannel.ConsenterSupport interface Whenever a block is written, it writes to the Batches channel to allow for synchronization
func (*ConsenterSupport) Append ¶ added in v1.4.1
func (mcs *ConsenterSupport) Append(block *cb.Block) error
Append appends a new block to the ledger in its raw form, unlike WriteBlock that also mutates its metadata.
func (*ConsenterSupport) Block ¶ added in v1.4.0
func (mcs *ConsenterSupport) Block(number uint64) *cb.Block
Block returns the block with the given number or nil if not found
func (*ConsenterSupport) BlockCutter ¶
func (mcs *ConsenterSupport) BlockCutter() blockcutter.Receiver
BlockCutter returns BlockCutterVal
func (*ConsenterSupport) ChannelConfig ¶ added in v1.4.2
func (mcs *ConsenterSupport) ChannelConfig() channelconfig.Channel
ChannelConfig returns ChannelConfigVal
func (*ConsenterSupport) ChannelID ¶ added in v1.5.6
func (mcs *ConsenterSupport) ChannelID() string
ChannelID returns the channel ID this specific consenter instance is associated with
func (*ConsenterSupport) ClassifyMsg ¶
func (mcs *ConsenterSupport) ClassifyMsg(chdr *cb.ChannelHeader) msgprocessor.Classification
ClassifyMsg returns ClassifyMsgVal, ClassifyMsgErr
func (*ConsenterSupport) CreateNextBlock ¶
func (mcs *ConsenterSupport) CreateNextBlock(data []*cb.Envelope) *cb.Block
CreateNextBlock creates a simple block structure with the given data
func (*ConsenterSupport) Height ¶
func (mcs *ConsenterSupport) Height() uint64
Height returns the number of blocks of the chain this specific consenter instance is associated with
func (*ConsenterSupport) NewSignatureHeader ¶
func (mcs *ConsenterSupport) NewSignatureHeader() (*cb.SignatureHeader, error)
NewSignatureHeader returns an empty signature header
func (*ConsenterSupport) ProcessConfigMsg ¶
ProcessConfigMsg returns ProcessConfigMsgVal, ConfigSeqVal, ProcessConfigMsgErr
func (*ConsenterSupport) ProcessConfigUpdateMsg ¶
func (mcs *ConsenterSupport) ProcessConfigUpdateMsg(env *cb.Envelope) (config *cb.Envelope, configSeq uint64, err error)
ProcessConfigUpdateMsg returns ProcessConfigUpdateMsgVal, ConfigSeqVal, ProcessConfigUpdateMsgErr
func (*ConsenterSupport) ProcessNormalMsg ¶
func (mcs *ConsenterSupport) ProcessNormalMsg(env *cb.Envelope) (configSeq uint64, err error)
ProcessNormalMsg returns ConfigSeqVal, ProcessNormalMsgErr
func (*ConsenterSupport) Sequence ¶
func (mcs *ConsenterSupport) Sequence() uint64
Sequence returns SequenceVal
func (*ConsenterSupport) Serialize ¶ added in v1.5.6
func (mcs *ConsenterSupport) Serialize() ([]byte, error)
Serialize returns bytes
func (*ConsenterSupport) SharedConfig ¶
func (mcs *ConsenterSupport) SharedConfig() channelconfig.Orderer
SharedConfig returns SharedConfigVal
func (*ConsenterSupport) Sign ¶
func (mcs *ConsenterSupport) Sign(message []byte) ([]byte, error)
Sign returns the bytes passed in
func (*ConsenterSupport) VerifyBlockSignature ¶ added in v1.4.0
func (mcs *ConsenterSupport) VerifyBlockSignature(_ []*protoutil.SignedData, _ *cb.ConfigEnvelope) error
VerifyBlockSignature verifies a signature of a block
func (*ConsenterSupport) WriteBlock ¶
func (mcs *ConsenterSupport) WriteBlock(block *cb.Block, encodedMetadataValue []byte)
WriteBlock writes data to the Blocks channel
func (*ConsenterSupport) WriteConfigBlock ¶
func (mcs *ConsenterSupport) WriteConfigBlock(block *cb.Block, encodedMetadataValue []byte)
WriteConfigBlock calls WriteBlock