Co-authored-by: atheeshp <59333759+atheeshp@users.noreply.github.com>
This commit is contained in:
parent
2809154caf
commit
939fa27625
@ -154,18 +154,18 @@ func (keeper Keeper) ChargeDeposit(ctx context.Context, proposalID uint64, destA
|
||||
|
||||
var remainingAmount sdk.Coins
|
||||
|
||||
for _, coins := range deposit.Amount {
|
||||
burnAmount := sdkmath.LegacyNewDecFromInt(coins.Amount).Mul(rate).TruncateInt()
|
||||
for _, coin := range deposit.Amount {
|
||||
burnAmount := sdkmath.LegacyNewDecFromInt(coin.Amount).Mul(rate).TruncateInt()
|
||||
// remaining amount = deposits amount - burn amount
|
||||
remainingAmount = remainingAmount.Add(
|
||||
sdk.NewCoin(
|
||||
coins.Denom,
|
||||
coins.Amount.Sub(burnAmount),
|
||||
coin.Denom,
|
||||
coin.Amount.Sub(burnAmount),
|
||||
),
|
||||
)
|
||||
cancellationCharges = cancellationCharges.Add(
|
||||
sdk.NewCoin(
|
||||
coins.Denom,
|
||||
coin.Denom,
|
||||
burnAmount,
|
||||
),
|
||||
)
|
||||
@ -190,7 +190,7 @@ func (keeper Keeper) ChargeDeposit(ctx context.Context, proposalID uint64, destA
|
||||
// get the distribution module account address
|
||||
distributionAddress := keeper.authKeeper.GetModuleAddress(disttypes.ModuleName)
|
||||
switch {
|
||||
case len(destAddress) == 0:
|
||||
case destAddress == "":
|
||||
// burn the cancellation charges from deposits
|
||||
err := keeper.bankKeeper.BurnCoins(ctx, types.ModuleName, cancellationCharges)
|
||||
if err != nil {
|
||||
|
||||
@ -119,7 +119,7 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1.MsgSubmitPropos
|
||||
}, nil
|
||||
}
|
||||
|
||||
// CancelProposals implements the MsgServer.CancelProposal method.
|
||||
// CancelProposal implements the MsgServer.CancelProposal method.
|
||||
func (k msgServer) CancelProposal(goCtx context.Context, msg *v1.MsgCancelProposal) (*v1.MsgCancelProposalResponse, error) {
|
||||
_, err := k.authKeeper.AddressCodec().StringToBytes(msg.Proposer)
|
||||
if err != nil {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user