diff --git a/util/issue_commands.go b/util/issue_commands.go index e11e874..89d42a8 100644 --- a/util/issue_commands.go +++ b/util/issue_commands.go @@ -101,18 +101,14 @@ func SendUpdateRedeemClaim(goCtx context.Context, beneficiary string, id uint64, buildSignBroadcastTx(goCtx, loggingContext, sendingValidatorAddress, msg) } -func SendPLMNTTokens(goCtx context.Context, beneficiary sdk.AccAddress, amount uint64, denominator string) { +func SendTokens(goCtx context.Context, beneficiary sdk.AccAddress, amount uint64, denominator string) { sendingValidatorAddress := config.GetConfig().ValidatorAddress coin := sdk.NewCoin(denominator, sdk.NewIntFromUint64(amount)) coins := sdk.NewCoins(coin) - orgAddr, err := sdk.AccAddressFromBech32(sendingValidatorAddress) - if err != nil { - ctx := sdk.UnwrapSDKContext(goCtx) - GetAppLogger().Error(ctx, "sending PLMNT tokens: couldn't convert validator address to Address object") - } + orgAddr := sdk.MustAccAddressFromBech32(sendingValidatorAddress) msg := banktypes.NewMsgSend(orgAddr, beneficiary, coins) - loggingContext := "sending PLMNT tokens" + loggingContext := "sending " + denominator + " tokens" buildSignBroadcastTx(goCtx, loggingContext, sendingValidatorAddress, msg) } diff --git a/x/machine/keeper/msg_server_attest_machine.go b/x/machine/keeper/msg_server_attest_machine.go index 8d73605..21e952e 100644 --- a/x/machine/keeper/msg_server_attest_machine.go +++ b/x/machine/keeper/msg_server_attest_machine.go @@ -77,7 +77,7 @@ func (k msgServer) sendInitialFundingTokensToMachine(goCtx context.Context, mach logMsg := fmt.Sprintf("transferring %v tokens to address %s", keeperParams.GetDaoMachineFundingAmount(), machineAddress.String()) util.GetAppLogger().Info(ctx, logMsg) - util.SendPLMNTTokens(goCtx, machineAddress, keeperParams.GetDaoMachineFundingAmount(), keeperParams.DaoMachineFundingDenom) + util.SendTokens(goCtx, machineAddress, keeperParams.GetDaoMachineFundingAmount(), keeperParams.GetDaoMachineFundingDenom()) } func validateExtendedPublicKey(issuer string, cfg chaincfg.Params) bool {