dymension
dymension copied to clipboard
refactor slices functions, with new `slices` functionality
example:
this could all be shortened by a generic dedupe function, and https://pkg.go.dev/slices#ContainsFunc or https://pkg.go.dev/slices#IndexFunc
psuedo:
if len(permissioned) != len(deduped(permissioned)) {
..}
if i := slices.indexFunc(permissioned, func(x){
_, err := sdk.AccAddressFromBech32(x)
return err!=nil
}
}) {..}
something like that
Originally posted by @danwt in https://github.com/dymensionxyz/dymension/pull/712#discussion_r1535405565