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

fix: GetComputedPrices panic #1262

Merged
merged 13 commits into from
Aug 23, 2022
Merged

fix: GetComputedPrices panic #1262

merged 13 commits into from
Aug 23, 2022

Conversation

RafilxTenfen
Copy link
Contributor

@RafilxTenfen RafilxTenfen commented Aug 22, 2022

Description

  • Add verification for mapped value

related to: #1261


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • added appropriate labels to the PR
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@RafilxTenfen RafilxTenfen self-assigned this Aug 22, 2022
@RafilxTenfen
Copy link
Contributor Author

RafilxTenfen commented Aug 22, 2022

This is a temporary solution to avoid panic on price-feeder we should investigate the correct behavior of ComputeTVWAP -

// Ref : https://en.wikipedia.org/wiki/Time-weighted_average_price
func ComputeTVWAP(prices provider.AggregatedProviderCandles) (map[string]sdk.Dec, error) {

@RafilxTenfen RafilxTenfen marked this pull request as ready for review August 22, 2022 14:49
@RafilxTenfen RafilxTenfen requested a review from a team as a code owner August 22, 2022 14:49
@zarazan
Copy link
Contributor

zarazan commented Aug 22, 2022

This is a temporary solution to avoid panic on price-feeder we should investigate the correct behavior of ComputeTVWAP -

// Ref : https://en.wikipedia.org/wiki/Time-weighted_average_price
func ComputeTVWAP(prices provider.AggregatedProviderCandles) (map[string]sdk.Dec, error) {

If this is a temporary solution should there be a comment in the code to explain that. And maybe a corresponding github issue?

Copy link
Collaborator

@adamewozniak adamewozniak left a comment

Choose a reason for hiding this comment

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

💯

price-feeder/oracle/convert.go Show resolved Hide resolved
price-feeder/oracle/oracle_test.go Outdated Show resolved Hide resolved
RafilxTenfen and others added 3 commits August 22, 2022 12:54
Co-authored-by: Adam Wozniak <29418299+adamewozniak@users.noreply.github.com>
@RafilxTenfen
Copy link
Contributor Author

This is a temporary solution to avoid panic on price-feeder we should investigate the correct behavior of ComputeTVWAP -

// Ref : https://en.wikipedia.org/wiki/Time-weighted_average_price
func ComputeTVWAP(prices provider.AggregatedProviderCandles) (map[string]sdk.Dec, error) {

If this is a temporary solution should there be a comment in the code to explain that. And maybe a corresponding github issue?

Done at dc31d38

@RafilxTenfen RafilxTenfen requested a review from a team as a code owner August 22, 2022 20:13
Copy link
Collaborator

@adamewozniak adamewozniak left a comment

Choose a reason for hiding this comment

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

just a couple nitpicks but lgtm 👍

price-feeder/oracle/oracle_test.go Show resolved Hide resolved
price-feeder/oracle/convert.go Outdated Show resolved Hide resolved
@mergify mergify bot merged commit bb38bfe into main Aug 23, 2022
@mergify mergify bot deleted the rafilx/pf-computed-price-panic branch August 23, 2022 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants