Closed EGreg closed 1 year ago
You should probably modify getAddresses(roles)
to return the above format, but in this case role0, role1 would not be the roles with index 0, 1 in roles array, but rather in the array passed
See if you use this format of getAddresses in any other repos, and then change the expected result from a single-dimensional array (concatenated basically) to a two-dimensional array.
Then duplicates look better, anyway.
Example for getAddresses([2, 5, 7]) => [ [0x..., 0x....], [0x....], [] ]
Also implement getAddressesByRole(roleIndex, offset, limit)
If a role index wasn't being used somehow, then send empty array of addresses for that role
getAddresses(uint8 rolesIndex)
replaced with getAddresses(uint8[] calldata roleIndexes)
Also if roleIndexes is empty then need to use function signature getAddresses without paramaters like getAddresses()
,
It would return all roles and the addresses in all roles. Basically it would make a loop through all roles, and return the following array:
[ addressesForRole0, addressesForRole1, addressesForRole2, ]
If a role index wasn't being used somehow, then send empty array of addresses for that role
Also here please rename
rolesIndex
toroleIndex
... also here rename to roleIndexes everywhere rename "rolesIndex" to "roleIndex" in the code