Skip to content

Commit

Permalink
feat: accountant initialize payment state
Browse files Browse the repository at this point in the history
  • Loading branch information
hopeyen committed Oct 25, 2024
1 parent ecc7b7e commit 02e00c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/meterer/meterer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ func setup(_ *testing.M) {
// metrics.NewNoopMetrics(),
)

// initialize the on-chain state
if err := mt.ChainPaymentState.RefreshOnchainPaymentState(context.Background(), nil); err != nil {
panic("failed to make initial query to the on-chain state")
}

mt.Start(context.Background())
}

Expand Down
2 changes: 2 additions & 0 deletions disperser/cmd/apiserver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ func RunDisperserServer(ctx *cli.Context) error {
if err != nil {
return fmt.Errorf("failed to create onchain payment state: %w", err)
}
// fresh payment state
if err := paymentChainState.RefreshOnchainPaymentState(context.Background(), nil); err != nil {
return fmt.Errorf("failed to make initial query to the on-chain state: %w", err)
}
Expand All @@ -134,6 +135,7 @@ func RunDisperserServer(ctx *cli.Context) error {
logger,
// metrics.NewNoopMetrics(),
)

}

var ratelimiter common.RateLimiter
Expand Down

0 comments on commit 02e00c3

Please sign in to comment.