Skip to content

Commit

Permalink
fix: refactor last_epoch_time
Browse files Browse the repository at this point in the history
  • Loading branch information
dongsam committed Sep 16, 2021
1 parent 66462ed commit bc6c13b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions x/farming/keeper/epoch.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

func (k Keeper) GetLastEpochTime(ctx sdk.Context) (time.Time, bool) {
store := ctx.KVStore(k.storeKey)
bz := store.Get(types.GlobalLastEpochTimeKey)
bz := store.Get(types.LastEpochTimeKey)
if bz == nil {
return time.Time{}, false
}
Expand All @@ -32,7 +32,7 @@ func (k Keeper) SetLastEpochTime(ctx sdk.Context, t time.Time) {
panic(err)
}
bz := k.cdc.MustMarshal(ts)
store.Set(types.GlobalLastEpochTimeKey, bz)
store.Set(types.LastEpochTimeKey, bz)
}

func (k Keeper) AdvanceEpoch(ctx sdk.Context) error {
Expand Down
2 changes: 1 addition & 1 deletion x/farming/spec/02_state.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ The parameters of the Plan state are:

## Epoch

- GlobalLastEpochTime: `[]byte("globalLastEpochTime") -> ProtocolBuffer(Timestamp)`
- LastEpochTime: `[]byte("lastEpochTime") -> ProtocolBuffer(Timestamp)`

- CurrentEpochDays: `[]byte("currentEpochDays") -> uint32`

Expand Down
6 changes: 3 additions & 3 deletions x/farming/types/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ const (

// keys for farming store prefixes
var (
GlobalPlanIdKey = []byte("globalPlanId")
GlobalLastEpochTimeKey = []byte("globalLastEpochTime")
CurrentEpochDaysKey = []byte("currentEpochDays")
GlobalPlanIdKey = []byte("globalPlanId")
LastEpochTimeKey = []byte("lastEpochTime")
CurrentEpochDaysKey = []byte("currentEpochDays")

PlanKeyPrefix = []byte{0x11}

Expand Down

0 comments on commit bc6c13b

Please sign in to comment.