Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
leonz789 committed Feb 20, 2025
1 parent 0368bba commit 33b0706
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions x/oracle/keeper/prices.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,33 +241,26 @@ func (k Keeper) AppendPriceTR(ctx sdk.Context, tokenID uint64, priceTR types.Pri
func (k Keeper) GrowRoundID(ctx sdk.Context, tokenID, nextRoundID uint64) (price string, roundID uint64) {
storedNextRoundID := k.GetNextRoundID(ctx, tokenID)
pTR, ok := k.GetPriceTRLatest(ctx, tokenID)

if ok {
price = pTR.Price
} else {
pTR = types.PriceTimeRound{}
}

if nextRoundID < storedNextRoundID {
roundID = storedNextRoundID - 1
// we don't append new price if storedNextRoundID is larger than expected
return
}

if nextRoundID > storedNextRoundID {
// if storedNextRoundID is too old, we just set it with input params
store := k.getPriceTRStore(ctx, tokenID)
b := make([]byte, 8)
binary.BigEndian.PutUint64(b, nextRoundID)
store.Set(types.PricesNextRoundIDKey, b)
}

roundID = nextRoundID

pTR.RoundID = nextRoundID

k.AppendPriceTR(ctx, tokenID, pTR, types.NilDetID)

return
}

Expand Down

0 comments on commit 33b0706

Please sign in to comment.