Skip to content

Commit

Permalink
removed unused functions, renamed other functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Zavgorodnii committed Dec 19, 2024
1 parent 0935c09 commit b4bb189
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
14 changes: 2 additions & 12 deletions x/tokenfactory/keeper/bankactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand All @@ -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
}
2 changes: 1 addition & 1 deletion x/tokenfactory/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b4bb189

Please sign in to comment.