Skip to content

Commit

Permalink
CNS-376: rename plansFs to plansFS in plans (for consistency)
Browse files Browse the repository at this point in the history
  • Loading branch information
orenl-lava committed Apr 13, 2023
1 parent 8a8cc64 commit 2cdbedc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions x/plans/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type (
Keeper struct {
memKey sdk.StoreKey
paramstore paramtypes.Subspace
plansFs common.FixationStore
plansFS common.FixationStore
}
)

Expand All @@ -36,12 +36,12 @@ func NewKeeper(
return &Keeper{
memKey: memKey,
paramstore: ps,
plansFs: fs,
plansFS: fs,
}
}

func (k Keeper) BeginBlock(ctx sdk.Context) {
k.plansFs.AdvanceBlock(ctx)
k.plansFS.AdvanceBlock(ctx)
}

func (k Keeper) Logger(ctx sdk.Context) log.Logger {
Expand Down
10 changes: 5 additions & 5 deletions x/plans/keeper/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func (k Keeper) AddPlan(ctx sdk.Context, planToAdd types.Plan) error {

// TODO: verify the CU per epoch field

err := k.plansFs.AppendEntry(ctx, planToAdd.GetIndex(), planToAdd.Block, &planToAdd)
err := k.plansFS.AppendEntry(ctx, planToAdd.GetIndex(), planToAdd.Block, &planToAdd)
if err != nil {
details := map[string]string{"planToAdd": planToAdd.String()}
return utils.LavaError(ctx, k.Logger(ctx), "AddPlan_add_fixated_entry_failed", details, err.Error())
Expand All @@ -25,7 +25,7 @@ func (k Keeper) AddPlan(ctx sdk.Context, planToAdd types.Plan) error {
// GetPlan gets the latest plan from the KVStore and increments its refcount
func (k Keeper) GetPlan(ctx sdk.Context, index string) (val types.Plan, found bool) {
var plan types.Plan
if found := k.plansFs.GetEntry(ctx, index, &plan); !found {
if found := k.plansFS.GetEntry(ctx, index, &plan); !found {
return types.Plan{}, false
}
return plan, true
Expand All @@ -34,18 +34,18 @@ func (k Keeper) GetPlan(ctx sdk.Context, index string) (val types.Plan, found bo
// FindPlan gets a plan with nearest-smaller block (without changing its refcount)
func (k Keeper) FindPlan(ctx sdk.Context, index string, block uint64) (val types.Plan, found bool) {
var plan types.Plan
if found := k.plansFs.FindEntry(ctx, index, block, &plan); !found {
if found := k.plansFS.FindEntry(ctx, index, block, &plan); !found {
return types.Plan{}, false
}
return plan, true
}

// PutPlan finds a plan with nearest-smaller block and decrements its refcount
func (k Keeper) PutPlan(ctx sdk.Context, index string, block uint64) {
k.plansFs.PutEntry(ctx, index, block)
k.plansFS.PutEntry(ctx, index, block)
}

// GetAllPlanIndices gets from the KVStore all the plans' indices
func (k Keeper) GetAllPlanIndices(ctx sdk.Context) (val []string) {
return k.plansFs.GetAllEntryIndices(ctx)
return k.plansFS.GetAllEntryIndices(ctx)
}

0 comments on commit 2cdbedc

Please sign in to comment.