From 93dc8f4519c51773b07895932e95c60a21df5c7a Mon Sep 17 00:00:00 2001 From: Joel Smith Date: Sat, 26 Aug 2023 16:24:27 -0500 Subject: [PATCH] Handle Transfer Errors --- app/decorators/dedcuct_fee.go | 7 ++++++- scripts/test_node.sh | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/decorators/dedcuct_fee.go b/app/decorators/dedcuct_fee.go index 151a17e97..9708e6c5a 100644 --- a/app/decorators/dedcuct_fee.go +++ b/app/decorators/dedcuct_fee.go @@ -139,7 +139,12 @@ func HandleZeroFees(keeper bankkeeper.Keeper, ctx sdk.Context, deductFeesFromAcc ctx.Logger().Error("HandleZeroFees", "Payment", payment) // keeper.SendCoinsFromModuleToAccount(ctx, "feeprepay", deductFeesFromAcc.GetAddress(), payment) - keeper.SendCoinsFromModuleToModule(ctx, feeprepaytypes.ModuleName, types.FeeCollectorName, payment) + err := keeper.SendCoinsFromModuleToModule(ctx, feeprepaytypes.ModuleName, types.FeeCollectorName, payment) + + // Handle error + if err != nil { + ctx.Logger().Error("HandleZeroFees", "Error transfering funds from module to module", err) + } ctx.Logger().Error("HandleZeroFees", "Ending", true) } diff --git a/scripts/test_node.sh b/scripts/test_node.sh index 83e446308..228ea8cf0 100755 --- a/scripts/test_node.sh +++ b/scripts/test_node.sh @@ -93,7 +93,7 @@ from_scratch () { BINARY genesis add-genesis-account $KEY 10000000ujuno,1000utest --keyring-backend $KEYRING BINARY genesis add-genesis-account $KEY2 1000000ujuno,1000utest --keyring-backend $KEYRING BINARY genesis add-genesis-account juno1see0htr47uapjvcvh0hu6385rp8lw3emu85lh5 100000000000ujuno --keyring-backend $KEYRING - BINARY genesis add-genesis-account juno1xgj5vkjknnvwu3je3usm2fasvr6a9ust9q7gxm 100000000000ujuno --keyring-backend $KEYRING # feeprepay + # BINARY genesis add-genesis-account juno1xgj5vkjknnvwu3je3usm2fasvr6a9ust9q7gxm 100000000000ujuno --keyring-backend $KEYRING # feeprepay BINARY genesis gentx $KEY 1000000ujuno --keyring-backend $KEYRING --chain-id $CHAIN_ID