-
Notifications
You must be signed in to change notification settings - Fork 57
Feat(json_rpc): implement new method searchDataRequests #2656
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
base: master
Are you sure you want to change the base?
Conversation
The HashMap will not be persisted to storage. Nodes must explicitly opt-in.
| let reverse = msg.reverse.unwrap_or_default(); | ||
| let mut since_epoch: i64 = msg.since.unwrap_or_default(); | ||
| if since_epoch < 0 { | ||
| since_epoch = i64::from(self.current_epoch.unwrap()).saturating_add(since_epoch); |
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.
| since_epoch = i64::from(self.current_epoch.unwrap()).saturating_add(since_epoch); | |
| if let Some(current) = self.current_epoch { | |
| since_epoch = i64::from(current).saturating_add(since_epoch); | |
| } |
| .filter_map(|tuple| { | ||
| if tuple.0 >= since_epoch { | ||
| Some(*tuple) | ||
| } else { | ||
| None | ||
| } | ||
| }) |
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.
We may use filter instead of map_filter
| .filter_map(|tuple| { | |
| if tuple.0 >= since_epoch { | |
| Some(*tuple) | |
| } else { | |
| None | |
| } | |
| }) | |
| .filter(|(epoch, _)| *epoch >= since_epoch) |
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.
changing to filter makes later collect to fail
No description provided.