Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: minor pass through twap imrovements #2284

Merged
merged 6 commits into from
Aug 3, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion x/gamm/twap/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ func NewKeeper(storeKey sdk.StoreKey, transientKey *sdk.TransientStoreKey, param

// TODO: make this read from a parameter, or hardcode it.
func (k *Keeper) PruneEpochIdentifier(ctx sdk.Context) string {
return "daily"
return "day"
p0mvn marked this conversation as resolved.
Show resolved Hide resolved
}
4 changes: 2 additions & 2 deletions x/gamm/twap/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}