From b4bb189cee9433958ae9b73fba1c30d9e1f9f016 Mon Sep 17 00:00:00 2001 From: Andrei Zavgorodnii Date: Thu, 19 Dec 2024 14:30:42 +0000 Subject: [PATCH] removed unused functions, renamed other functions --- x/tokenfactory/keeper/bankactions.go | 14 ++------------ x/tokenfactory/keeper/keeper.go | 2 +- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/x/tokenfactory/keeper/bankactions.go b/x/tokenfactory/keeper/bankactions.go index d355e323a..e0f4ae7de 100644 --- a/x/tokenfactory/keeper/bankactions.go +++ b/x/tokenfactory/keeper/bankactions.go @@ -50,7 +50,7 @@ func (k Keeper) burnFrom(ctx sdk.Context, amount sdk.Coin, burnFrom string) erro return status.Errorf(codes.Internal, "burning from module accounts is forbidden") } - escrowAccounts := k.GetAllEscrowAccounts(ctx) + escrowAccounts := k.GetAllIBCEscrowAccounts(ctx) if _, ok := escrowAccounts[burnFromAcc.String()]; ok { return status.Errorf(codes.Internal, "burning from escrow accounts is forbidden") @@ -92,7 +92,7 @@ func (k Keeper) forceTransfer(ctx sdk.Context, amount sdk.Coin, fromAddr, toAddr return status.Errorf(codes.Internal, "force transfer to module accounts is forbidden") } - escrowAccounts := k.GetAllEscrowAccounts(ctx) + escrowAccounts := k.GetAllIBCEscrowAccounts(ctx) if _, ok := escrowAccounts[transferFromAcc.String()]; ok { return status.Errorf(codes.Internal, "force transfer from IBC escrow accounts is forbidden") @@ -119,13 +119,3 @@ func (k Keeper) isModuleAccount(ctx sdk.Context, addr sdk.AccAddress) bool { return false } - -func (k Keeper) isEscrowAccount(escrowAccounts []sdk.AccAddress, addr sdk.AccAddress) bool { - for _, escrowAccount := range escrowAccounts { - if escrowAccount.Equals(addr) { - return true - } - } - - return false -} diff --git a/x/tokenfactory/keeper/keeper.go b/x/tokenfactory/keeper/keeper.go index 3cdf299b8..841863498 100644 --- a/x/tokenfactory/keeper/keeper.go +++ b/x/tokenfactory/keeper/keeper.go @@ -102,7 +102,7 @@ func (k Keeper) CreateModuleAccount(ctx sdk.Context) { k.accountKeeper.GetModuleAccount(ctx, types.ModuleName) } -func (k Keeper) GetAllEscrowAccounts(ctx sdk.Context) map[string]bool { +func (k Keeper) GetAllIBCEscrowAccounts(ctx sdk.Context) map[string]bool { escrowAddresses := make(map[string]bool) transferChannels := k.channelKeeper.GetAllChannels(ctx)