func makeRequestProcessor(captureSeq requestSeqCapturer, pendingReq requestlist.List, viewState viewstate.State, applyRequest requestApplier) requestProcessor {
	return func(request messages.Request) (new bool, err error) {
		new, releaseSeq := captureSeq(request)
		if !new {
			return false, nil
		}
		defer releaseSeq()
		pendingReq.Add(request)
		currentView, expectedView, releaseView := viewState.HoldView()
		defer releaseView()
		if currentView != expectedView {
			return true, nil
		}
		if err := applyRequest(request, currentView); err != nil {
			return false, fmt.Errorf("failed to apply Request: %s", err)
		}
		return true, nil
	}
}
makeRequestProcessor constructs an instance of requestProcessor
using id as the current replica ID, n as the total number of nodes,
and the supplied abstractions.
package minbft
import (
	"fmt"
	"time"
	"github.com/hyperledger-labs/minbft/api"
	"github.com/hyperledger-labs/minbft/common/logger"
	"github.com/hyperledger-labs/minbft/core/internal/clientstate"
	"github.com/hyperledger-labs/minbft/core/internal/messagelog"
	"github.com/hyperledger-labs/minbft/core/internal/requestlist"
	"github.com/hyperledger-labs/minbft/core/internal/viewstate"
	"github.com/hyperledger-labs/minbft/messages"
)
type requestReplier func(request messages.Request) <-chan messages.Reply
type requestValidator func(request messages.Request) error
type requestProcessor func(request messages.Request) (new bool, err error)
type requestApplier func(request messages.Request, view uint64) error
type requestExecutor func(request messages.Request)
type requestSeqCapturer func(request messages.Request) (new bool, release func())
type requestSeqPreparer func(request messages.Request) (new bool)
type requestSeqRetirer func(request messages.Request) (new bool)
type requestTimerStarter func(request messages.Request, view uint64)
type requestTimerStopper func(request messages.Request)
type requestTimeoutHandler func(view uint64)
type requestTimeoutProvider func() time.Duration
type prepareTimerStarter func(request messages.Request, view uint64)
type prepareTimerStopper func(request messages.Request)
type prepareTimeoutProvider func() time.Duration
func makeRequestValidator(verify messageSignatureVerifier) requestValidator {
	return func(request messages.Request) error {
		return verify(request)
	}
}