Skip to content

Commit

Permalink
provide eventstore to the block processor (#1159)
Browse files Browse the repository at this point in the history
  • Loading branch information
charithabandi authored Dec 13, 2024
1 parent 95e2a25 commit e4c324d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions node/block_processor/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down
4 changes: 2 additions & 2 deletions node/block_processor/transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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{},
}
Expand Down
2 changes: 1 addition & 1 deletion node/block_processor/transactions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e4c324d

Please sign in to comment.