-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change how profile data are stored #261
Comments
I think this is a good improvement, so if I understood well the |
@bragaz Exactly, the complete inheritance chain would then be:
This would allow the EditThe above depicted inheritance chain should be the final one. However, I think it would be better to first implement the following:
And then, during #258 implementation, extend this as well to match the above described one. |
@RiccardoM After closing the stargate PR this could be done in the next milestone |
Context
Currently the profiles are stored using a custom keeper and they are saved using the following data structure:
However, since a profile is just an extension of a Cosmos account, I think we should merge the two concepts into a single one.
Solution
In order to achieve a better organization of the code, what we could do is extend the Cosmos
Account
interface with the data that are currently defined inside theProfile
structure. To do so, we could simply define aProfile
as being the following:This would have the following pros.
No need to have a custom saving mechanism
By extending the
Account
interface, we could allow theauth
module to take care of storing the profiles data.No duplicated data
Since the
Account
interface already contains anAddress
field, we would not have to include that inside theProfile
structure (currently theCreator
field).Easier future extension
If other fields are going to be added in the future to the
Account
interface (eg. different types of keys), then we would have them directly inside the profiles as well. An example could be the address defined inside Adding withdraw address to Profile #258Easier data retrieval
Since a profile would be a simple account, one single API call (
/auth/<address>
) would be sufficient to get all the latest info about a profileWhat do you guys @kwunyeung @bragaz think about this?
The text was updated successfully, but these errors were encountered: