Skip to content

Commit

Permalink
feat: update clp cli for rewards params update
Browse files Browse the repository at this point in the history
  • Loading branch information
snobbee committed Nov 15, 2023
1 parent e19b32e commit 0f1a88b
Show file tree
Hide file tree
Showing 4 changed files with 221 additions and 121 deletions.
2 changes: 2 additions & 0 deletions proto/sifnode/clp/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ message MsgUpdateRewardsParamsRequest {
string signer = 1 [ (gogoproto.moretags) = "yaml:\"signer\"" ];
uint64 liquidity_removal_lock_period = 2; // in blocks
uint64 liquidity_removal_cancel_period = 3; // in blocks
uint64 rewards_lock_period = 4; // in blocks
string rewards_epoch_identifier = 5; // week, day, hour, etc
}

message MsgUpdateRewardsParamsResponse {}
Expand Down
6 changes: 6 additions & 0 deletions x/clp/client/cli/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ const (
FlagMinimumReceivingAmount = "minReceivingAmount"
FlagLiquidityRemovalLockPeriod = "lockPeriod"
FlagLiquidityRemovalCancelPeriod = "cancelPeriod"
FlagRewardsLockPeriod = "rewardsLockPeriod"
FlagRewardsEpochIdentifier = "rewardsEpochIdentifier"
FlagDefaultMultiplier = "defaultMultiplier"
FlagRewardPeriods = "path"
FlagBlockRate = "blockRate"
Expand Down Expand Up @@ -56,6 +58,8 @@ var (
FsMinReceivingAmount = flag.NewFlagSet("", flag.ContinueOnError)
FsLiquidityRemovalLockPeriod = flag.NewFlagSet("", flag.ContinueOnError)
FsLiquidityRemovalCancelPeriod = flag.NewFlagSet("", flag.ContinueOnError)
FsRewardsLockPeriod = flag.NewFlagSet("", flag.ContinueOnError)
FsRewardsEpochIdentifier = flag.NewFlagSet("", flag.ContinueOnError)
FsDefaultMultiplier = flag.NewFlagSet("", flag.ContinueOnError)
FsFlagRewardPeriods = flag.NewFlagSet("", flag.ContinueOnError)
FsBlockRate = flag.NewFlagSet("", flag.ContinueOnError)
Expand Down Expand Up @@ -102,6 +106,8 @@ func init() {
FsFlagNewPolicy.String(FlagNewPolicy, "", "Set a new policy / Modify existing policy")
FsLiquidityRemovalLockPeriod.String(FlagLiquidityRemovalLockPeriod, "", "Lock Period")
FsLiquidityRemovalCancelPeriod.String(FlagLiquidityRemovalCancelPeriod, "", "Unlock Period")
FsRewardsLockPeriod.String(FlagRewardsLockPeriod, "", "Rewards Lock Period")
FsRewardsEpochIdentifier.String(FlagRewardsEpochIdentifier, "", "Rewards Epoch Identifier")
FsDefaultMultiplier.String(FlagDefaultMultiplier, "", "Pool Multiplier")
FsFlagRewardPeriods.String(FlagRewardPeriods, "", "Path to Json File containing reward periods")
FsFlagMintParams.String(FlagMintParams, "", "Inflation")
Expand Down
4 changes: 4 additions & 0 deletions x/clp/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ func GetCmdUpdateRewardParams() *cobra.Command {
Signer: signer.String(),
LiquidityRemovalCancelPeriod: viper.GetUint64(FlagLiquidityRemovalCancelPeriod),
LiquidityRemovalLockPeriod: viper.GetUint64(FlagLiquidityRemovalLockPeriod),
RewardsLockPeriod: viper.GetUint64(FlagRewardsLockPeriod),
RewardsEpochIdentifier: viper.GetString(FlagRewardsEpochIdentifier),
}
if err := msg.ValidateBasic(); err != nil {
return err
Expand All @@ -118,6 +120,8 @@ func GetCmdUpdateRewardParams() *cobra.Command {
}
cmd.Flags().AddFlagSet(FsLiquidityRemovalCancelPeriod)
cmd.Flags().AddFlagSet(FsLiquidityRemovalLockPeriod)
cmd.Flags().AddFlagSet(FsRewardsLockPeriod)
cmd.Flags().AddFlagSet(FsRewardsEpochIdentifier)
flags.AddTxFlagsToCmd(cmd)
return cmd
}
Expand Down
Loading

0 comments on commit 0f1a88b

Please sign in to comment.