You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, this approach has two notable drawbacks. First, the use of loop iteration for validation can be resource-intensive. Second, since knownModules is a configuration parameter initialized with the keeper, any updates introducing new modules might lead to omissions.
Given these considerations, it would be more efficient and reliable to determine whether an address is a module account by directly checking its account type.
func (k Keeper) isModuleAccount(ctx sdk.Context, addr sdk.AccAddress) bool {
acc := k.authKeeper.GetAccount(ctx, addr)
if acc == nil {
return false
}
_, ok := acc.(authtypes.ModuleAccountI)
return ok
}
The text was updated successfully, but these errors were encountered:
The current implementation of
isModuleAccount
relie on iterating throughknownModules
to determine whether an address is a module account.neutron/x/tokenfactory/keeper/bankactions.go
Lines 92 to 105 in a6525cb
However, this approach has two notable drawbacks. First, the use of loop iteration for validation can be resource-intensive. Second, since knownModules is a configuration parameter initialized with the keeper, any updates introducing new modules might lead to omissions.
Given these considerations, it would be more efficient and reliable to determine whether an address is a module account by directly checking its account type.
The text was updated successfully, but these errors were encountered: