Skip to content

Commit 4521ee1

Browse files
committed
final touchups
1 parent 887a788 commit 4521ee1

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

x/manifest/abci.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,17 @@ func BeginBlocker(ctx context.Context, k keeper.Keeper, mk mintkeeper.Keeper, bk
5151
defer telemetry.ModuleSetGauge(minttypes.ModuleName, float32(mintedCoin.Amount.Int64()), "minted_tokens")
5252
}
5353

54+
bondedRatio, err := mk.BondedRatio(ctx)
55+
if err != nil {
56+
return err
57+
}
58+
5459
sdkCtx := sdk.UnwrapSDKContext(ctx)
5560
sdkCtx.EventManager().EmitEvent(
5661
sdk.NewEvent(
5762
minttypes.EventTypeMint,
58-
// sdk.NewAttribute(minttypes.AttributeKeyBondedRatio, bondedRatio.String()),
59-
// sdk.NewAttribute(minttypes.AttributeKeyInflation, minter.Inflation.String()),
63+
sdk.NewAttribute(minttypes.AttributeKeyBondedRatio, bondedRatio.String()),
64+
sdk.NewAttribute(minttypes.AttributeKeyInflation, mintedCoin.String()),
6065
// sdk.NewAttribute(minttypes.AttributeKeyAnnualProvisions, minter.AnnualProvisions.String()),
6166
sdk.NewAttribute(sdk.AttributeKeyAmount, mintedCoin.Amount.String()),
6267
),

x/manifest/client/cli/tx.go

+9-12
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import (
55
"strconv"
66
"strings"
77

8+
sdk "github.com/cosmos/cosmos-sdk/types"
9+
810
"github.com/liftedinit/manifest-ledger/x/manifest/types"
911
"github.com/spf13/cobra"
1012

@@ -34,40 +36,35 @@ func NewTxCmd() *cobra.Command {
3436
// contract for the module.
3537
func MsgUpdateParams() *cobra.Command {
3638
cmd := &cobra.Command{
37-
Use: "update-params address:1_000_000,address2:99_000_000 [inflation-enabled] [inflation-per-year-amount] [mint-denom]",
38-
Short: "Update the params (must be submitted from the authority)",
39-
Args: cobra.ExactArgs(1),
39+
Use: "update-params [address_pairs] [automatic_inflation_enabled] [inflation_per_year]",
40+
Short: "Update the params (must be submitted from the authority)",
41+
Example: `update-params address:1_000_000,address2:99_000_000 true 500000000umfx`,
42+
Args: cobra.ExactArgs(1),
4043
RunE: func(cmd *cobra.Command, args []string) error {
4144
cliCtx, err := client.GetClientTxContext(cmd)
4245
if err != nil {
4346
return err
4447
}
45-
4648
senderAddress := cliCtx.GetFromAddress()
4749

4850
sh, err := fromStrToStakeholders(args[0])
4951
if err != nil {
5052
return err
5153
}
5254

53-
isInflationEnabled, err := cmd.Flags().GetBool("inflation-enabled")
54-
if err != nil {
55-
return err
56-
}
57-
58-
inflationPerYearAmount, err := cmd.Flags().GetUint64("inflation-per-year-amount")
55+
isInflationEnabled, err := strconv.ParseBool(args[1])
5956
if err != nil {
6057
return err
6158
}
6259

63-
mintDenom, err := cmd.Flags().GetString("mint-denom")
60+
coin, err := sdk.ParseCoinNormalized(args[2])
6461
if err != nil {
6562
return err
6663
}
6764

6865
msg := &types.MsgUpdateParams{
6966
Authority: senderAddress.String(),
70-
Params: types.NewParams(sh, isInflationEnabled, inflationPerYearAmount, mintDenom),
67+
Params: types.NewParams(sh, isInflationEnabled, coin.Amount.Uint64(), coin.Denom),
7168
}
7269

7370
if err := msg.Validate(); err != nil {

0 commit comments

Comments
 (0)