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

feat: add oracle exchange rate query #45

Merged
merged 8 commits into from
Jul 16, 2023

Conversation

matthiasmatt
Copy link
Contributor

@matthiasmatt matthiasmatt commented Jul 13, 2023

This PR adds the exchange Rate query to the binding perp contract. We might want to rename binding perp at some point to encompass most of our interactions between wasm and the chain but since ExchangeRate is the only one we need outside of perp for now, i just included it here.

@matthiasmatt matthiasmatt marked this pull request as draft July 13, 2023 14:08
@matthiasmatt matthiasmatt marked this pull request as ready for review July 13, 2023 14:21
@codecov
Copy link

codecov bot commented Jul 13, 2023

Codecov Report

Patch coverage: 90.49% and project coverage change: +1.67 🎉

Comparison is base (20b2eba) 79.65% compared to head (c3476da) 81.33%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #45      +/-   ##
==========================================
+ Coverage   79.65%   81.33%   +1.67%     
==========================================
  Files          41       35       -6     
  Lines        3161     3434     +273     
==========================================
+ Hits         2518     2793     +275     
+ Misses        643      641       -2     
Impacted Files Coverage Δ
packages/bindings/src/querier.rs 0.00% <0.00%> (ø)
packages/bindings/src/query.rs 100.00% <ø> (ø)
packages/bindings/src/state.rs 100.00% <ø> (ø)
contracts/bindings-perp/src/msg.rs 63.95% <66.66%> (-1.53%) ⬇️
contracts/bindings-perp/src/contract.rs 90.30% <95.12%> (+1.41%) ⬆️
contracts/controller/src/contract.rs 78.76% <96.36%> (+7.29%) ⬆️
contracts/shifter/src/contract.rs 89.85% <96.36%> (+6.63%) ⬆️
contracts/bindings-perp/src/query.rs 98.98% <100.00%> (+0.11%) ⬆️
packages/dummy/src/exec.rs 95.48% <100.00%> (ø)
packages/dummy/src/query.rs 100.00% <100.00%> (ø)

... and 9 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

contracts/bindings-perp/src/query.rs Outdated Show resolved Hide resolved
contracts/bindings-perp/src/msg.rs Outdated Show resolved Hide resolved
@Unique-Divine Unique-Divine added the type: enhancement New feature or request label Jul 14, 2023
Copy link
Member

@Unique-Divine Unique-Divine left a comment

Choose a reason for hiding this comment

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

Contract version in c3476da has passing e2e tests:

@Unique-Divine Unique-Divine merged commit d815c0e into main Jul 16, 2023
5 checks passed
Unique-Divine added a commit that referenced this pull request Oct 10, 2023
* feat: add oracle exchange rate query

* fix: fix output of query type

* chore: update binaries

* fix: make exchange rate a sdk.dec

* feat: request exchange rate with multiple pairs

* fix: update readme

* wip

* feat(bindings-perp): fix oracle query and use simple hashmap for it rather than a struct

---------

Co-authored-by: Unique-Divine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants