Skip to content

Commit

Permalink
misc cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
stackman27 committed Aug 7, 2023
1 parent ae7018d commit 8709c4a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/upgrades/v17/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ func CreateUpgradeHandler(
}
}

// FlipTwapSpotPriceRecords flips the denoms and spot price of twap record of a given pool.
func FlipTwapSpotPriceRecords(ctx sdk.Context, poolIds []uint64, keepers *keepers.AppKeepers) error {
for _, poolId := range poolIds {
// check that this is a cl pool
Expand Down
3 changes: 1 addition & 2 deletions x/twap/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,14 @@ func (k Keeper) GetAllHistoricalPoolIndexedTWAPsForPoolId(ctx sdk.Context, poolI
}

// StoreNewRecord stores a record, in both the most recent record store and historical stores.
// NOTE: if it's a new Record make sure to update asset0 and asset1 as well.
func (k Keeper) StoreNewRecord(ctx sdk.Context, twap types.TwapRecord) {
store := ctx.KVStore(k.storeKey)
key := types.FormatMostRecentTWAPKey(twap.PoolId, twap.Asset0Denom, twap.Asset1Denom)
osmoutils.MustSet(store, key, &twap)
k.StoreHistoricalTWAP(ctx, twap)
}

// DeleteOldRecord deletes a record, in both the most recent record store and historical stores.
// DeleteOldRecord deletes a record, in most recent record store
func (k Keeper) DeleteOldRecord(ctx sdk.Context, twap types.TwapRecord) {
store := ctx.KVStore(k.storeKey)
key := types.FormatMostRecentTWAPKey(twap.PoolId, twap.Asset0Denom, twap.Asset1Denom)
Expand Down

0 comments on commit 8709c4a

Please sign in to comment.