-
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
Move distribution to legacy #963
Conversation
fn upgrade(&self) {} | ||
|
||
#[endpoint(clearSingleValueMappers)] | ||
fn clear_single_value_mappers(&self) { |
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.
So it is ok for this to be called by anyone?
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 don't see why it would be an issue to have it open?
for _ in 0..n { | ||
self.community_distribution_list().pop_front(); | ||
fn clear_community_distribution_list(&self, n: u64) -> (u64, usize) { | ||
let mut counter = 0; |
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.
Not really mandatory but would be good to have 2 extra things if we have polished the code.
- rename
n
with something more suggestive, likeelements_to_delete
- Add a require that the passed variable (whatever the rename) is > 0. Right now, if you pass 0, it will still remove 1 element.
} | ||
|
||
#[endpoint(clearUserLockedAssetMap)] | ||
fn clear_user_locked_asset_map(&self, n: u64) -> usize { | ||
fn clear_user_locked_asset_map(&self, n: u64) -> (u64, usize) { |
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.
Also, maybe add a comment about what is returned, like
// Returns number of processed elements and remaining elements in the storage.
Coverage SummaryTotals
FilesExpand
|
Contract comparison - from 5e828fd to 35af22b
|
Addressed in PR #965 |
System test:
https://github.com/lcswillems/xexchange-locked-asset-distribution-system-testing