Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hopeyen committed Dec 12, 2024
1 parent 61ca84b commit 0ca169f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion disperser/apiserver/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,11 @@ func newTestServer(transactor core.Writer, testName string) *apiserver.Dispersal
teardown()
panic("failed to create offchain store")
}
mt := meterer.NewMeterer(meterer.Config{}, mockState, store, logger)
mt := meterer.NewMeterer(meterer.Config{
ChainReadTimeout: 1 * time.Second,
OnchainUpdateInterval: 1 * time.Second,
OffchainPruneInterval: 1 * time.Second,
}, mockState, store, logger)
err = mt.ChainPaymentState.RefreshOnchainPaymentState(context.Background())
if err != nil {
panic("failed to make initial query to the on-chain state")
Expand Down
6 changes: 5 additions & 1 deletion disperser/apiserver/server_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,11 @@ func newTestServerV2(t *testing.T) *testComponents {
teardown()
panic("failed to create offchain store")
}
meterer := meterer.NewMeterer(meterer.Config{}, mockState, store, logger)
meterer := meterer.NewMeterer(meterer.Config{
ChainReadTimeout: 1 * time.Second,
OnchainUpdateInterval: 1 * time.Second,
OffchainPruneInterval: 1 * time.Second,
}, mockState, store, logger)

chainReader.On("GetCurrentBlockNumber").Return(uint32(100), nil)
chainReader.On("GetQuorumCount").Return(uint8(2), nil)
Expand Down
6 changes: 5 additions & 1 deletion test/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,11 @@ func mustMakeDisperser(t *testing.T, cst core.IndexedChainState, store disperser
panic("failed to make initial query to the on-chain state")
}

mt := meterer.NewMeterer(meterer.Config{}, mockState, offchainStore, logger)
mt := meterer.NewMeterer(meterer.Config{
ChainReadTimeout: 1 * time.Second,
OnchainUpdateInterval: 1 * time.Second,
OffchainPruneInterval: 1 * time.Second,
}, mockState, offchainStore, logger)
server := apiserver.NewDispersalServer(serverConfig, store, tx, logger, disperserMetrics, grpcprom.NewServerMetrics(), mt, ratelimiter, rateConfig, testMaxBlobSize)

return TestDisperser{
Expand Down

0 comments on commit 0ca169f

Please sign in to comment.