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

Oracle: allow multiple feed values from inner calls #920

Merged
merged 4 commits into from
Jun 2, 2023

Conversation

lemunozm
Copy link
Contributor

@lemunozm lemunozm commented May 31, 2023

Description

This PR shows an example of an implementation to allow calling feed_value() multiple times internally, avoiding the AlreadyFeeded error without being a breaking change and without effecting to the extrinsic behavior

Related issue: #919

@xlc
Copy link
Member

xlc commented May 31, 2023

I think this works. Just need some tests and docs.

@codecov-commenter
Copy link

Codecov Report

Merging #920 (33afe6f) into master (055e7db) will increase coverage by 0.00%.
The diff coverage is 90.90%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@           Coverage Diff           @@
##           master     #920   +/-   ##
=======================================
  Coverage   78.21%   78.21%           
=======================================
  Files         105      105           
  Lines       10621    10623    +2     
=======================================
+ Hits         8307     8309    +2     
  Misses       2314     2314           
Impacted Files Coverage Δ
oracle/src/lib.rs 75.00% <90.90%> (+0.92%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@lemunozm
Copy link
Contributor Author

lemunozm commented Jun 1, 2023

Would you agree to add to this PR a minor breaking change to allow passing Option<AccountId> to feed_value()? Would be much more ergonomic to have a "default" member easy to use.

@xlc
Copy link
Member

xlc commented Jun 1, 2023

I think it is ok.
It is a breaking change which isn't ideal, but otherwise the code itself won't be ideal as well. It is not worth to sacrifice code maintainability for such trivial breaking change.

@lemunozm lemunozm marked this pull request as ready for review June 1, 2023 11:58
Copy link
Contributor Author

@lemunozm lemunozm left a comment

Choose a reason for hiding this comment

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

I think this is ready for review. I've also added the test part related to these changes.

traits/src/data_provider.rs Show resolved Hide resolved
@xlc xlc merged commit 0482bf2 into open-web3-stack:master Jun 2, 2023
3 checks passed
@lemunozm lemunozm deleted the oracle/internal-feed branch June 2, 2023 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants