Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NoOpPrepareProposal ¶
func NoOpPrepareProposal() sdk.PrepareProposalHandler
NoOpPrepareProposal defines a no-op PrepareProposal handler. It will always return the transactions sent by the client's request.
func NoOpProcessProposal ¶
func NoOpProcessProposal() sdk.ProcessProposalHandler
NoOpProcessProposal defines a no-op ProcessProposal Handler. It will always return ACCEPT.
Types ¶
type ArtelaProposalHandler ¶
type ArtelaProposalHandler struct {
// contains filtered or unexported fields
}
DefaultProposalHandler defines the default ABCI PrepareProposal and ProcessProposal handlers.
func NewArtelaProposalHandler ¶
func NewArtelaProposalHandler(mp mempool.Mempool, txVerifier ProposalTxVerifier) ArtelaProposalHandler
func (ArtelaProposalHandler) PrepareProposalHandler ¶
func (h ArtelaProposalHandler) PrepareProposalHandler() sdk.PrepareProposalHandler
PrepareProposalHandler returns the default implementation for processing an ABCI proposal. The application's mempool is enumerated and all valid transactions are added to the proposal. Transactions are valid if they:
1) Successfully encode to bytes. 2) Are valid (i.e. pass runTx, AnteHandler only).
Enumeration is halted once RequestPrepareProposal.MaxBytes of transactions is reached or the mempool is exhausted.
Note:
- Step (2) is identical to the validation step performed in DefaultProcessProposal. It is very important that the same validation logic is used in both steps, and applications must ensure that this is the case in non-default handlers.
- If no mempool is set or if the mempool is a no-op mempool, the transactions requested from Tendermint will simply be returned, which, by default, are in FIFO order.
func (ArtelaProposalHandler) ProcessProposalHandler ¶
func (h ArtelaProposalHandler) ProcessProposalHandler() sdk.ProcessProposalHandler
ProcessProposalHandler returns the default implementation for processing an ABCI proposal. Every transaction in the proposal must pass 2 conditions:
1. The transaction bytes must decode to a valid transaction. 2. The transaction must be valid (i.e. pass runTx, AnteHandler only)
If any transaction fails to pass either condition, the proposal is rejected. Note that step (2) is identical to the validation step performed in DefaultPrepareProposal. It is very important that the same validation logic is used in both steps, and applications must ensure that this is the case in non-default handlers.
type ProposalTxVerifier ¶
type ProposalTxVerifier interface { PrepareProposalVerifyTx(tx sdk.Tx) ([]byte, error) ProcessProposalVerifyTx(txBz []byte) (sdk.Tx, error) }
ProposalTxVerifier defines the interface that is implemented by BaseApp, that any custom ABCI PrepareProposal and ProcessProposal handler can use to verify a transaction.