forked from osmosis-labs/osmosis-rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Demonstrate problem with twap decimals.
- Loading branch information
Showing
6 changed files
with
102 additions
and
21 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use cosmwasm_std::Coin; | ||
use osmosis_std::types::osmosis::gamm::v1beta1::{ | ||
QuerySpotPriceResponse, QuerySpotPriceRequest | ||
}; | ||
|
||
use osmosis_testing::{fn_execute, fn_query}; | ||
use osmosis_testing::{Module, Runner}; | ||
|
||
pub struct Gamm<'a, R: Runner<'a>> { | ||
runner: &'a R, | ||
} | ||
|
||
impl<'a, R: Runner<'a>> Module<'a, R> for Gamm<'a, R> { | ||
fn new(runner: &'a R) -> Self { | ||
Self { runner } | ||
} | ||
} | ||
|
||
impl<'a, R> Gamm<'a, R> | ||
where | ||
R: Runner<'a>, | ||
{ | ||
|
||
fn_query! { | ||
pub query_spot_price ["/osmosis.gamm.v1beta1.Query/SpotPrice"]: QuerySpotPriceRequest => QuerySpotPriceResponse | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use osmosis_std::types::osmosis::twap::v1beta1::{ | ||
ArithmeticTwapToNowRequest, ArithmeticTwapToNowResponse, | ||
}; | ||
|
||
use osmosis_testing::{fn_execute, fn_query}; | ||
use osmosis_testing::{Module, Runner}; | ||
|
||
pub struct Twap<'a, R: Runner<'a>> { | ||
runner: &'a R, | ||
} | ||
|
||
impl<'a, R: Runner<'a>> Module<'a, R> for Twap<'a, R> { | ||
fn new(runner: &'a R) -> Self { | ||
Self { runner } | ||
} | ||
} | ||
|
||
impl<'a, R> Twap<'a, R> | ||
where | ||
R: Runner<'a>, | ||
{ | ||
fn_query! { | ||
pub query_twap_price ["/osmosis.twap.v1beta1.Query/ArithmeticTwapToNow"]: ArithmeticTwapToNowRequest => ArithmeticTwapToNowResponse | ||
} | ||
} |