Skip to content
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

CollectionDataFeed: Minor changes #1351

Merged
merged 3 commits into from
May 17, 2023
Merged

Conversation

lemunozm
Copy link
Contributor

Description

Minor changes over collection-data-feed to prepare it for the OracleValuation feature.

Changes and Descriptions

  • Prices returned as Result instead of Option.
  • MockDataCollection with user callback.
  • Add license headers
  • Clear unused features

@lemunozm lemunozm added Q1-easy Can be done by primarily duplicating and adapting code. P7-asap Issue should be addressed in the next days. I6-refactoring Code needs refactoring. crcl-protocol Circle protocol related. labels May 17, 2023
@lemunozm lemunozm self-assigned this May 17, 2023
@lemunozm lemunozm force-pushed the feature/collection-data-result branch from 7eb31fc to f85eddb Compare May 17, 2023 09:13
@lemunozm lemunozm requested a review from hieronx May 17, 2023 10:08
@lemunozm lemunozm mentioned this pull request May 17, 2023
4 tasks
@lemunozm lemunozm enabled auto-merge (squash) May 17, 2023 10:58
Copy link
Contributor

@thea-leake thea-leake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

collection
.get_mut(data_id)
.map(|value| *value = Self::get(data_id))
if let Some(value) = collection.get_mut(data_id) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if It might read a little cleaner flattened with match, though feel free to disregard if not :)

match (collection.get_mut(data_id), Self::get(data_id)) {
    (Some(value), Ok(new_value)) => *value = new_value,
    _ => ()
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like your suggestion here @thea-leake!! I had the auto-merge enabled, but I'll update this in the next PRs. Thanks! 🙌🏻

@lemunozm lemunozm merged commit cefc4a2 into main May 17, 2023
@lemunozm lemunozm deleted the feature/collection-data-result branch May 17, 2023 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crcl-protocol Circle protocol related. I6-refactoring Code needs refactoring. P7-asap Issue should be addressed in the next days. Q1-easy Can be done by primarily duplicating and adapting code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants