-
Notifications
You must be signed in to change notification settings - Fork 8
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
Refactor peg token redeemption #367
base: master
Are you sure you want to change the base?
Conversation
src/dao.cpp
Outdated
@@ -3517,6 +3561,7 @@ void dao::reset() { | |||
delete_table<election_vote_table>(get_self(), 2); | |||
delete_table<election_vote_table>(get_self(), 3); | |||
delete_table<token_to_dao_table>(get_self(), get_self().value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be reward_token_to_dao_table instead of the old "token_to_dao_table"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean it is a alias for that, but for enhanced reading I can use that instead. Pushed to the next commit
Made one comment. Also kinda wondering why tokens aren't in a document, so there could be an edge dao_id -> TOKEN_EDGE_NAME -> TokenDoc (pegToken, rewardToken) ... then we would not need an extra table? Maybe too much for this PR but wondering why token info is in a separate table. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left one comment please check
In a sense, we already do this as we store the tokens in the DAO's settings document i.e. dao_id -> settings -> SettingsDoc (reward_token, peg_token). The actual issue is that for transfer action we don't know the DAO ID in advance, and we need to do the lookup by the Token symbol. We could iterate over all the settings documents and search for the one that matches the token but that would be very inefficient and could lead to more timeouts |
I see yeah because we don't get any info from the transfer listener other than the symbol... so we need to look up the symbol either way... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
assigntokdao
to specify which token is assigned (peg | reward)