From e4c324d004521c92bf369282e670a3e85defcb22 Mon Sep 17 00:00:00 2001 From: Charitha Bandi <45089429+charithabandi@users.noreply.github.com> Date: Fri, 13 Dec 2024 16:53:42 -0600 Subject: [PATCH] provide eventstore to the block processor (#1159) --- node/block_processor/processor.go | 1 + node/block_processor/transactions.go | 4 ++-- node/block_processor/transactions_test.go | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/node/block_processor/processor.go b/node/block_processor/processor.go index a54180e27..4a55e5672 100644 --- a/node/block_processor/processor.go +++ b/node/block_processor/processor.go @@ -73,6 +73,7 @@ func NewBlockProcessor(ctx context.Context, db DB, txapp TxApp, accounts Account validators: vs, snapshotter: sp, signer: signer, + events: es, log: logger, } diff --git a/node/block_processor/transactions.go b/node/block_processor/transactions.go index 7fad77497..80a03eabe 100644 --- a/node/block_processor/transactions.go +++ b/node/block_processor/transactions.go @@ -254,7 +254,7 @@ func (bp *BlockProcessor) prepareValidatorVoteBodyTx(ctx context.Context, nonce eventMap[*evt.ID()] = evt } - emptyTxSz, err := bp.emptyVodeBodyTxSize() + emptyTxSz, err := bp.emptyVoteBodyTxSize() if err != nil { return nil, err } @@ -322,7 +322,7 @@ func (bp *BlockProcessor) prepareValidatorVoteBodyTx(ctx context.Context, nonce // emptyVodeBodyTxSize returns the size of an empty validator vote body transaction. // used to estimate the size of the validator vote body transactions with events as the // size is directly proportional to the events size. -func (bp *BlockProcessor) emptyVodeBodyTxSize() (int64, error) { +func (bp *BlockProcessor) emptyVoteBodyTxSize() (int64, error) { payload := &types.ValidatorVoteBodies{ Events: []*types.VotableEvent{}, } diff --git a/node/block_processor/transactions_test.go b/node/block_processor/transactions_test.go index 68be4b5f3..baf3e025a 100644 --- a/node/block_processor/transactions_test.go +++ b/node/block_processor/transactions_test.go @@ -534,7 +534,7 @@ func TestPrepareVoteBodyTx(t *testing.T) { events: []*types.VotableEvent{evt1, evt2, evt3}, fn: func(ctx context.Context, bp *BlockProcessor, es *mockEventStore) error { - emptyTxSize, err := bp.emptyVodeBodyTxSize() + emptyTxSize, err := bp.emptyVoteBodyTxSize() require.NoError(t, err) // support evt1