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

Serp settpay #386

Merged
merged 21 commits into from
Jul 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ members = [
"lib-serml/dex/*",
"lib-serml/evm/*",
"lib-serml/example",
"lib-serml/prices",
"lib-serml/serp/serp-auction",
# "lib-serml/serp/serp-settpay",
"lib-serml/serp/serp-staking",
"lib-serml/serp/serp-treasury",
"lib-serml/serp/*",
"lib-serml/settmint/*",
"lib-serml/support",
"lib-serml/tokens/*",
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ The Setters.JS is the Web3 Ethers.JS compatibility library for the Setheum EVM,
For all the SERML (Setheum Runtime Module Library) modules like the;
[bridges](./lib-serml/bridges),
[dex](./lib-serml/dex),
[prices](./lib-serml/prices),
[prices](./lib-serml/serp/serp-prices),
[support](./lib-serml/support),
[tokens](./lib-serml/tokens),
[NFTs](./lib-serml/nft),
Expand Down Expand Up @@ -142,7 +142,7 @@ Bench bot can take care of syncing branch with `master` and generating WeightInf

### Generate module weights

Comment on a PR `/bench runtime module <setheum_name>` i.e.: `setheum_prices`
Comment on a PR `/bench runtime module <setheum_name>` i.e.: `serp_prices`

Bench bot will do the benchmarking, generate `weights.rs` file push changes into your branch.

Expand Down
48 changes: 48 additions & 0 deletions lib-serml/serp/serp-auction/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,58 @@ impl MockPriceSource {
}
}
impl PriceProvider<CurrencyId> for MockPriceSource {
fn get_peg_currency_by_currency_id(_currency_id: CurrencyId) -> CurrencyId {
Default::default()
}

fn get_peg_price(_currency_id: CurrencyId) -> Option<Price> {
Some(Price::one())
}

fn get_fiat_price(_currency_id: CurrencyId) -> Option<Price> {
Some(Price::one())
}

fn get_fiat_usd_fixed_price() -> Option<Price> {
Some(Price::one())
}

fn get_settusd_fixed_price() -> Option<Price> {
Some(Price::one())
}

fn get_stablecoin_fixed_price(_currency_id: CurrencyId) -> Option<Price> {
Some(Price::one())
}

fn get_stablecoin_market_price(_currency_id: CurrencyId) -> Option<Price> {
Some(Price::one())
}

fn get_relative_price(_base: CurrencyId, _quota: CurrencyId) -> Option<Price> {
RELATIVE_PRICE.with(|v| *v.borrow_mut())
}

fn get_market_relative_price(_base: CurrencyId, _quote: CurrencyId) -> Option<Price> {
Some(Price::one())
}

fn get_coin_to_peg_relative_price(_currency_id: CurrencyId) -> Option<Price> {
Some(Price::one())
}

fn get_setter_basket_peg_price() -> Option<Price> {
Some(Price::one())
}

fn get_setter_fixed_price() -> Option<Price> {
Some(Price::one())
}

fn get_market_price(_currency_id: CurrencyId) -> Option<Price> {
Some(Price::one())
}

fn get_price(_currency_id: CurrencyId) -> Option<Price> {
None
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "setheum-prices"
name = "serp-prices"
version = "0.8.0"
authors = ["Setheum Labs"]
edition = "2018"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use support::{mocks::MockCurrencyIdMapping, ExchangeRate, Ratio};
pub type AccountId = u128;
pub type BlockNumber = u64;

mod setheum_prices {
mod serp_prices {
pub use super::super::*;
}

Expand Down Expand Up @@ -394,7 +394,7 @@ construct_runtime!(
UncheckedExtrinsic = UncheckedExtrinsic
{
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
SetheumPrices: prices::{Pallet, Storage, Call, Event<T>},
SerpPrices: prices::{Pallet, Storage, Call, Event<T>},
Tokens: orml_tokens::{Pallet, Call, Storage, Event<T>},
}
);
Expand Down
Loading