multichain

package
v0.0.0-...-99016a9 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsenterSupport

type ConsenterSupport struct {
	// SharedConfigVal is the value returned by SharedConfig()
	SharedConfigVal *mockconfig.Orderer

	// BlockCutterVal is the value returned by BlockCutter()
	BlockCutterVal *mockblockcutter.Receiver

	// Blocks is the channel where WriteBlock writes the most recently created block
	Blocks chan *cb.Block

	// ChainIDVal is the value returned by ChainID()
	ChainIDVal string

	// HeightVal is the value returned by Height()
	HeightVal uint64

	// NextBlockVal stores the block created by the most recent CreateNextBlock() call
	NextBlockVal *cb.Block
}

ConsenterSupport is used to mock the multichain.ConsenterSupport interface Whenever a block is written, it writes to the Batches channel to allow for synchronization

func (*ConsenterSupport) BlockCutter

func (mcs *ConsenterSupport) BlockCutter() blockcutter.Receiver

BlockCutter returns BlockCutterVal

func (*ConsenterSupport) ChainID

func (mcs *ConsenterSupport) ChainID() string

ChainID returns the chain ID this specific consenter instance is associated with

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

func (mcs *ConsenterSupport) SharedConfig() config.Orderer

SharedConfig returns SharedConfigVal

func (*ConsenterSupport) Sign

func (mcs *ConsenterSupport) Sign(message []byte) ([]byte, error)

Sign returns the bytes passed in

func (*ConsenterSupport) WriteBlock

func (mcs *ConsenterSupport) WriteBlock(block *cb.Block, _committers []filter.Committer, encodedMetadataValue []byte) *cb.Block

WriteBlock writes data to the Blocks channel Note that _committers is ignored by this mock implementation

Jump to

Keyboard shortcuts

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