-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit '6347f1dad2d234b352fb3ba0cd2b6d8ee0fb5e32' into jh/scaff…
…old-liquidfarm * commit '6347f1dad2d234b352fb3ba0cd2b6d8ee0fb5e32': fix: rename reward-auction to rewards-auction query command chore: fix RewardsAuctions query command, apply updated spec to store LiquidFarm object fix: rename lfCoin to UnfarmingCoin and add validation check for the liquid coin denom
- Loading branch information
Showing
18 changed files
with
257 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package liquidfarming | ||
|
||
import ( | ||
"fmt" | ||
"time" | ||
|
||
"github.com/cosmos/cosmos-sdk/telemetry" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
|
||
"github.com/cosmosquad-labs/squad/v2/x/liquidfarming/keeper" | ||
"github.com/cosmosquad-labs/squad/v2/x/liquidfarming/types" | ||
) | ||
|
||
func BeginBlocker(ctx sdk.Context, k keeper.Keeper) { | ||
defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) | ||
|
||
liquidFarmSet := map[uint64]types.LiquidFarm{} | ||
for _, liquidFarm := range k.GetAllLiquidFarms(ctx) { | ||
liquidFarmSet[liquidFarm.PoolId] = liquidFarm | ||
} | ||
|
||
paramsLiquidFarmSet := map[uint64]types.LiquidFarm{} | ||
for _, liquidFarm := range k.GetParams(ctx).LiquidFarms { | ||
liquidFarmSet[liquidFarm.PoolId] = liquidFarm | ||
} | ||
|
||
for poolId := range paramsLiquidFarmSet { | ||
delete(liquidFarmSet, poolId) | ||
} | ||
|
||
if len(liquidFarmSet) != 0 { | ||
// Means that LiquidFarm is removed in params | ||
fmt.Println("Removed") | ||
} | ||
if len(paramsLiquidFarmSet) != 0 { | ||
// Means that LiquidFarm is newly added in params | ||
fmt.Println("Added") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.