mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-11-24 06:25:47 +00:00
improved code
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
This commit is contained in:
parent
e38d58187e
commit
a97614a7f5
@ -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)
|
||||
}
|
||||
|
||||
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user