Skip to content

Commit

Permalink
fix: Make sure oracle param cache is updated in clientless tick
Browse files Browse the repository at this point in the history
  • Loading branch information
rbajollari committed Jul 31, 2024
1 parent 804a2f4 commit cc93fdd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions oracle/oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,20 @@ func (o *Oracle) tick(ctx context.Context) error {
func (o *Oracle) tickClientless(ctx context.Context) error {
o.logger.Debug().Msg("executing clientless oracle tick")

blockHeight, err := o.oracleClient.ChainHeight.GetChainHeight()
if err != nil {
return err
}
if blockHeight < 1 {
return fmt.Errorf("expected positive block height")
}

// Make sure param cache does not become outdated.
_, err = o.GetParamCache(ctx, blockHeight)
if err != nil {
return err
}

return o.SetPrices(ctx)
}

Expand Down

0 comments on commit cc93fdd

Please sign in to comment.