Skip to content

Commit

Permalink
use options
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Nov 20, 2024
1 parent 5fea5cd commit 8daaa0f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion server/v2/cometbft/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ type consensus[T transaction.Tx] struct {
appCodec codec.Codec
txCodec transaction.Codec[T]
store types.Store
streaming streaming.Manager
listener *appdata.Listener
snapshotManager *snapshots.Manager
streamingManager streaming.Manager
mempool mempool.Mempool[T]

cfg Config
Expand Down
1 change: 1 addition & 0 deletions server/v2/cometbft/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ func DefaultServerOptions[T transaction.Tx]() ServerOptions[T] {
VerifyVoteExtensionHandler: handlers.NoOpVerifyVoteExtensionHandler(),
ExtendVoteHandler: handlers.NoOpExtendVote(),
Mempool: func(cfg map[string]any) mempool.Mempool[T] { return mempool.NoOpMempool[T]{} },
StreamingManager: streaming.Manager{},
SnapshotOptions: func(cfg map[string]any) snapshots.SnapshotOptions { return snapshots.NewSnapshotOptions(0, 0) },
SnapshotExtensions: []snapshots.ExtensionSnapshotter{},
AddrPeerFilter: nil,
Expand Down
3 changes: 1 addition & 2 deletions server/v2/cometbft/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (
cometlog "cosmossdk.io/server/v2/cometbft/log"
"cosmossdk.io/server/v2/cometbft/mempool"
"cosmossdk.io/server/v2/cometbft/types"
"cosmossdk.io/server/v2/streaming"
"cosmossdk.io/store/v2/snapshots"

"github.com/cosmos/cosmos-sdk/client"
Expand Down Expand Up @@ -174,9 +173,9 @@ func New[T transaction.Tx](
logger: logger,
txCodec: txCodec,
appCodec: appCodec,
streaming: streaming.Manager{},
listener: listener,
snapshotManager: snapshotManager,
streamingManager: srv.serverOptions.StreamingManager,
mempool: srv.serverOptions.Mempool(cfg),
lastCommittedHeight: atomic.Int64{},
prepareProposalHandler: srv.serverOptions.PrepareProposalHandler,
Expand Down
2 changes: 1 addition & 1 deletion server/v2/cometbft/streaming.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (c *consensus[T]) streamDeliverBlockChanges(
}
}

for _, streamingListener := range c.streaming.Listeners {
for _, streamingListener := range c.streamingManager.Listeners {
events, err := streaming.IntoStreamingEvents(events)
if err != nil {
return err
Expand Down

0 comments on commit 8daaa0f

Please sign in to comment.