diff --git a/x/gamm/twap/keeper.go b/x/gamm/twap/keeper.go index 46ad1cccbe3..9e92e9684e4 100644 --- a/x/gamm/twap/keeper.go +++ b/x/gamm/twap/keeper.go @@ -17,11 +17,13 @@ type Keeper struct { ammkeeper types.AmmInterface } +const pruneEpochIdentifier = "day" + func NewKeeper(storeKey sdk.StoreKey, transientKey *sdk.TransientStoreKey, paramSpace paramtypes.Subspace, ammKeeper types.AmmInterface) *Keeper { return &Keeper{storeKey: storeKey, transientKey: transientKey, paramSpace: paramSpace, ammkeeper: ammKeeper} } // TODO: make this read from a parameter, or hardcode it. func (k *Keeper) PruneEpochIdentifier(ctx sdk.Context) string { - return "daily" + return pruneEpochIdentifier } diff --git a/x/gamm/twap/store.go b/x/gamm/twap/store.go index e7bf9a551b8..421760c1b84 100644 --- a/x/gamm/twap/store.go +++ b/x/gamm/twap/store.go @@ -95,7 +95,7 @@ func (k Keeper) storeNewRecord(ctx sdk.Context, twap types.TwapRecord) { // returns the TWAP record from state for (id, t', asset0, asset1), // where t' is such that: // * t' <= t -// * there exists no t'' in state, where t'' < t' +// * there exists no `t'' <= t` in state, where `t' < t''` // // This returns an error if: // * there is no historical record in state at or before t @@ -140,6 +140,6 @@ func (k Keeper) getRecordAtOrBeforeTime(ctx sdk.Context, poolId uint64, t time.T return twap, nil } } - return types.TwapRecord{}, fmt.Errorf("TWAP not found, but there are twaps available for this time."+ + return types.TwapRecord{}, fmt.Errorf("TWAP not found, but there are other twaps available for this time."+ " Were provided asset0denom and asset1denom (%s, %s) correct, and in order (asset0 > asset1)?", asset0Denom, asset1Denom) }