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

package blockcutter

import "github.com/hyperledger/fabric/orderer/mocks/common/blockcutter"

Index

Package Files

blockcutter.go

type Receiver Uses

type Receiver struct {
    // IsolatedTx causes Ordered returns [][]{curBatch, []{newTx}}, false when set to true
    IsolatedTx bool

    // CutAncestors causes Ordered returns [][]{curBatch}, true when set to true
    CutAncestors bool

    // CutNext causes Ordered returns [][]{append(curBatch, newTx)}, false when set to true
    CutNext bool

    // SkipAppendCurBatch causes Ordered to skip appending to curBatch
    SkipAppendCurBatch bool

    // Block is a channel which is read from before returning from Ordered, it is useful for synchronization
    // If you do not wish synchronization for whatever reason, simply close the channel
    Block chan struct{}
    // contains filtered or unexported fields
}

Receiver mocks the blockcutter.Receiver interface

func NewReceiver Uses

func NewReceiver() *Receiver

NewReceiver returns the mock blockcutter.Receiver implementation

func (*Receiver) CurBatch Uses

func (mbc *Receiver) CurBatch() []*cb.Envelope

func (*Receiver) Cut Uses

func (mbc *Receiver) Cut() []*cb.Envelope

Cut terminates the current batch, returning it

func (*Receiver) Ordered Uses

func (mbc *Receiver) Ordered(env *cb.Envelope) ([][]*cb.Envelope, bool)

Ordered will add or cut the batch according to the state of Receiver, it blocks reading from Block on return

Package blockcutter imports 3 packages (graph) and is imported by 1 packages. Updated 2019-01-22. Refresh now. Tools for package owners.