From 9664568c9e519e7dce3b9bf2bed80efb3696adcc Mon Sep 17 00:00:00 2001 From: Sean King Date: Mon, 17 Jan 2022 17:15:13 +0100 Subject: [PATCH] nit: update err syntax --- modules/apps/29-fee/keeper/escrow.go | 9 +++------ modules/apps/29-fee/keeper/msg_server.go | 6 ++---- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/modules/apps/29-fee/keeper/escrow.go b/modules/apps/29-fee/keeper/escrow.go index 9ba1709a8dc..2574843d9b7 100644 --- a/modules/apps/29-fee/keeper/escrow.go +++ b/modules/apps/29-fee/keeper/escrow.go @@ -117,18 +117,15 @@ func (k Keeper) RefundFeesOnChannel(ctx sdk.Context, portID, channelID string) e // refund all fees to refund address // Use SendCoins rather than the module account send functions since refund address may be a user account or module address. // if any `SendCoins` call returns an error, we return error and stop iteration - err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, refundAccAddr, identifiedFee.Fee.ReceiveFee) - if err != nil { + if err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, refundAccAddr, identifiedFee.Fee.ReceiveFee); err != nil { refundErr = err return true } - err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, refundAccAddr, identifiedFee.Fee.AckFee) - if err != nil { + if err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, refundAccAddr, identifiedFee.Fee.AckFee); err != nil { refundErr = err return true } - err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, refundAccAddr, identifiedFee.Fee.TimeoutFee) - if err != nil { + if err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, refundAccAddr, identifiedFee.Fee.TimeoutFee); err != nil { refundErr = err return true } diff --git a/modules/apps/29-fee/keeper/msg_server.go b/modules/apps/29-fee/keeper/msg_server.go index dec2f27e928..cc60036e190 100644 --- a/modules/apps/29-fee/keeper/msg_server.go +++ b/modules/apps/29-fee/keeper/msg_server.go @@ -44,8 +44,7 @@ func (k Keeper) PayPacketFee(goCtx context.Context, msg *types.MsgPayPacketFee) } identifiedPacket := types.NewIdentifiedPacketFee(packetId, msg.Fee, msg.Signer, msg.Relayers) - err := k.EscrowPacketFee(ctx, identifiedPacket) - if err != nil { + if err := k.EscrowPacketFee(ctx, identifiedPacket); err != nil { return nil, err } @@ -58,8 +57,7 @@ func (k Keeper) PayPacketFee(goCtx context.Context, msg *types.MsgPayPacketFee) func (k Keeper) PayPacketFeeAsync(goCtx context.Context, msg *types.MsgPayPacketFeeAsync) (*types.MsgPayPacketFeeAsyncResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - err := k.EscrowPacketFee(ctx, &msg.IdentifiedPacketFee) - if err != nil { + if err := k.EscrowPacketFee(ctx, &msg.IdentifiedPacketFee); err != nil { return nil, err }