From cdbfdc8c32292569227d0755f588ddcf45c4364b Mon Sep 17 00:00:00 2001 From: MichaelWang <46394603+RevelationOfTuring@users.noreply.github.com> Date: Fri, 7 Aug 2020 16:05:55 +0800 Subject: [PATCH] Merge PR: remove the bankkeeper check before any send/multi-send tx (#314) * FINISH: remove the bankkeeper check before any send/multi-send tx * OPTIMIZE: recover go.sum * OPTIMIZE: remove const for send disable check --- x/token/handler.go | 8 -------- x/token/types/errors.go | 6 ------ 2 files changed, 14 deletions(-) diff --git a/x/token/handler.go b/x/token/handler.go index 2c68a7f582..8328d129d9 100644 --- a/x/token/handler.go +++ b/x/token/handler.go @@ -252,10 +252,6 @@ func handleMsgTokenMint(ctx sdk.Context, keeper Keeper, msg types.MsgTokenMint, } func handleMsgMultiSend(ctx sdk.Context, keeper Keeper, msg types.MsgMultiSend, logger log.Logger) sdk.Result { - if !keeper.bankKeeper.GetSendEnabled(ctx) { - return types.ErrSendDisabled(DefaultCodespace).Result() - } - var transfers string var coinNum int for _, transferUnit := range msg.Transfers { @@ -286,10 +282,6 @@ func handleMsgMultiSend(ctx sdk.Context, keeper Keeper, msg types.MsgMultiSend, } func handleMsgSend(ctx sdk.Context, keeper Keeper, msg types.MsgSend, logger log.Logger) sdk.Result { - if !keeper.bankKeeper.GetSendEnabled(ctx) { - return types.ErrSendDisabled(DefaultCodespace).Result() - } - err := keeper.SendCoinsFromAccountToAccount(ctx, msg.FromAddress, msg.ToAddress, msg.Amount) if err != nil { return sdk.ErrInsufficientCoins(fmt.Sprintf("insufficient coins(need %s)", diff --git a/x/token/types/errors.go b/x/token/types/errors.go index 8d2f82f527..6b6f738ab1 100644 --- a/x/token/types/errors.go +++ b/x/token/types/errors.go @@ -15,7 +15,6 @@ const ( CodeInvalidAsset sdk.CodeType = 6 CodeInvalidCommon sdk.CodeType = 7 CodeBlockedRecipient sdk.CodeType = 8 - CodeSendDisabled sdk.CodeType = 9 ) // ErrBlockedRecipient returns an error when a transfer is tried on a blocked recipient @@ -23,11 +22,6 @@ func ErrBlockedRecipient(codespace sdk.CodespaceType, blockedAddr string) sdk.Er return sdk.NewError(codespace, CodeBlockedRecipient, "failed. %s is not allowed to receive transactions", blockedAddr) } -// ErrSendDisabled returns an error when the transaction sending is disabled in bank module -func ErrSendDisabled(codespace sdk.CodespaceType) sdk.Error { - return sdk.NewError(codespace, CodeSendDisabled, "failed. send transactions are currently disabled") -} - func ErrInvalidDexList(codespace sdk.CodespaceType, message string) sdk.Error { return sdk.NewError(codespace, CodeInvalidDexList, message) }