Skip to content

Commit

Permalink
Merge pull request #501 from Setheum-Labs/bump-to-0.9.0
Browse files Browse the repository at this point in the history
Bump to 0.9.0
  • Loading branch information
balqaasem authored Aug 30, 2021
2 parents ca81c34 + 2ff2552 commit f3ea87e
Show file tree
Hide file tree
Showing 23 changed files with 35 additions and 115 deletions.
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "lib-openrml"]
path = lib-openrml
url = https://github.com/open-web3-stack/open-runtime-module-library
url = https://github.com/open-web3-stack/open-runtime-module-library.git
[submodule "predeploy-contracts"]
path = predeploy-contracts
url = https://github.com/Setheum-Labs/predeploy-contracts
url = https://github.com/Setheum-Labs/predeploy-contracts.git
20 changes: 2 additions & 18 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions inspect/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ structopt = "0.3.8"

# Substrate dependencies
sc-cli = { version = "0.9.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" }
sc-client-api = { version = "3.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" }
sc-service = { version = "0.9.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" }
sp-blockchain = { version = "3.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8", default-features = false }
sp-runtime = { version = "3.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" }
5 changes: 1 addition & 4 deletions lib-serml/bridges/chainbridge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ authors = ["Setheum Labs"]
edition = "2018"

[dependencies]
# external
serde = { version = "1.0.124", optional = true }
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }

# Substrate dependencies
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8", default-features = false }
Expand All @@ -21,7 +18,7 @@ sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkad
orml-traits = { path = "../../../lib-openrml/traits", default-features = false }

# special dependencies
chainbridge = { git = "https://github.com/Setheum-Labs/chainbridge-substrate", branch = "master", default-features = false }
chainbridge = { git = "https://github.com/Slixon-Technologies/chainbridge-substrate", default-features = false }

# local dependencies
support = { package = "setheum-support", path = "../../support", default-features = false }
Expand Down
3 changes: 2 additions & 1 deletion lib-serml/bridges/chainbridge/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ impl orml_tokens::Config for Runtime {
type ExistentialDeposits = ExistentialDeposits;
type OnDust = ();
type MaxLocks = ();
type DustRemovalWhitelist = ();
}

ord_parameter_types! {
Expand All @@ -91,7 +92,7 @@ ord_parameter_types! {
parameter_types! {
pub const LocalChainId: chainbridge::ChainId = 2;
pub const ProposalLifetime: BlockNumber = 10;
pub DNARResourceId: chainbridge::ResourceId = chainbridge::derive_resource_id(LocalChainId::get(), b"DNAR");
pub DNARResourceId: chainbridge::ResourceId = chainbridge::derive_resource_id(LocalChainId::get(), b"set");
pub const DNAR: CurrencyId = CurrencyId::Token(TokenSymbol::DNAR);
pub WETHResourceId: chainbridge::ResourceId = chainbridge::derive_resource_id(0, b"weth");
pub WETH: CurrencyId = CurrencyId::ChainSafe(WETHResourceId::get());
Expand Down
1 change: 1 addition & 0 deletions lib-serml/bridges/renvm-bridge/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ impl orml_tokens::Config for Runtime {
type ExistentialDeposits = ExistentialDeposits;
type OnDust = ();
type MaxLocks = ();
type DustRemovalWhitelist = ();
}

parameter_types! {
Expand Down
1 change: 1 addition & 0 deletions lib-serml/dex/dex/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ impl orml_tokens::Config for Runtime {
type ExistentialDeposits = ExistentialDeposits;
type OnDust = ();
type MaxLocks = ();
type DustRemovalWhitelist = ();
}

ord_parameter_types! {
Expand Down
1 change: 1 addition & 0 deletions lib-serml/evm/evm-accounts/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ impl orml_tokens::Config for Runtime {
type ExistentialDeposits = ExistentialDeposits;
type OnDust = ();
type MaxLocks = ();
type DustRemovalWhitelist = ();
}

parameter_types! {
Expand Down
1 change: 1 addition & 0 deletions lib-serml/evm/evm-manager/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ impl orml_tokens::Config for Runtime {
type ExistentialDeposits = ExistentialDeposits;
type OnDust = ();
type MaxLocks = ();
type DustRemovalWhitelist = ();
}

parameter_types! {
Expand Down
1 change: 1 addition & 0 deletions lib-serml/evm/evm/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ impl orml_tokens::Config for Test {
type ExistentialDeposits = ExistentialDeposits;
type OnDust = ();
type MaxLocks = ();
type DustRemovalWhitelist = ();
}

parameter_types! {
Expand Down
15 changes: 2 additions & 13 deletions lib-serml/serp/serp-ocw/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ impl orml_tokens::Config for Runtime {
type ExistentialDeposits = ExistentialDeposits;
type OnDust = ();
type MaxLocks = ();
type DustRemovalWhitelist = ();
}

parameter_types! {
Expand Down Expand Up @@ -224,19 +225,7 @@ impl PriceProvider<CurrencyId> for MockPriceSource {
fn get_relative_price(_base: CurrencyId, _quota: CurrencyId) -> Option<Price> {
RELATIVE_PRICE.with(|v| *v.borrow_mut())
}

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

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

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


fn get_price(_currency_id: CurrencyId) -> Option<Price> {
None
}
Expand Down
4 changes: 2 additions & 2 deletions lib-serml/serp/serp-prices/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,15 @@ fn get_price_of_stable_currency_id() {
ExtBuilder::default().build().execute_with(|| {
assert_eq!(
SerpPrices::get_price(SETUSD),
Some(Price::saturating_from_integer(990000u128))
Some(Price::saturating_from_integer(1000000u128))
); // 1 USD, right shift the decimal point (18-12) places
});
}

#[test]
fn get_price_of_lp_token_currency_id() {
ExtBuilder::default().build().execute_with(|| {
assert_eq!(MockDEX::get_liquidity_pool(SETUSD, DRAM), (10000, 200));
assert_eq!(MockDEX::get_liquidity_pool(SETUSD, DRAM), (0, 0));
assert_eq!(SerpPrices::get_price(LP_SETUSD_DRAM), None);
assert_ok!(Tokens::deposit(LP_SETUSD_DRAM, &1, 100));
assert_eq!(Tokens::total_issuance(LP_SETUSD_DRAM), 100);
Expand Down
1 change: 1 addition & 0 deletions lib-serml/serp/serp-staking/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ impl orml_tokens::Config for Runtime {
type ExistentialDeposits = ExistentialDeposits;
type OnDust = ();
type MaxLocks = ();
type DustRemovalWhitelist = ();
}
impl pallet_balances::Config for Test {
type MaxLocks = MaxLocks;
Expand Down
2 changes: 2 additions & 0 deletions lib-serml/serp/serp-treasury/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ impl<T: Config> SerpTreasury<T::AccountId> for Pallet<T> {
Ok(())
}

// TODO: Update to 1% per day not 50% per day.
/// Reward SETR cashdrop to vault
fn setter_cashdrop_to_vault() -> DispatchResult {
let free_balance = T::Currency::free_balance(T::SetterCurrencyId::get(), &T::SettPayTreasuryAccountId::get());
Expand All @@ -274,6 +275,7 @@ impl<T: Config> SerpTreasury<T::AccountId> for Pallet<T> {
Ok(())
}

// TODO: Update to 1% per day not 50% per day.
/// SerpUp ratio for SettPay Cashdrops
fn usdj_cashdrop_to_vault() -> DispatchResult {
let free_balance = T::Currency::free_balance(T::GetSetUSDCurrencyId::get(), &T::SettPayTreasuryAccountId::get());
Expand Down
15 changes: 2 additions & 13 deletions lib-serml/serp/serp-treasury/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ impl orml_tokens::Config for Runtime {
type ExistentialDeposits = ExistentialDeposits;
type OnDust = ();
type MaxLocks = ();
type DustRemovalWhitelist = ();
}

parameter_types! {
Expand Down Expand Up @@ -180,19 +181,7 @@ impl PriceProvider<CurrencyId> for MockPriceSource {
fn get_relative_price(_base: CurrencyId, _quota: CurrencyId) -> Option<Price> {
RELATIVE_PRICE.with(|v| *v.borrow_mut())
}

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

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

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


fn get_price(_currency_id: CurrencyId) -> Option<Price> {
None
}
Expand Down
15 changes: 2 additions & 13 deletions lib-serml/settmint/settmint-engine/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ impl orml_tokens::Config for Runtime {
type ExistentialDeposits = ExistentialDeposits;
type OnDust = ();
type MaxLocks = ();
type DustRemovalWhitelist = ();
}

parameter_types! {
Expand Down Expand Up @@ -167,19 +168,7 @@ impl PriceProvider<CurrencyId> for MockPriceSource {
_ => None,
}
}

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

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

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


fn get_price(_currency_id: CurrencyId) -> Option<Price> {
None
}
Expand Down
15 changes: 2 additions & 13 deletions lib-serml/settmint/settmint-gateway/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ impl orml_tokens::Config for Runtime {
type ExistentialDeposits = ExistentialDeposits;
type OnDust = ();
type MaxLocks = ();
type DustRemovalWhitelist = ();
}

parameter_types! {
Expand Down Expand Up @@ -138,19 +139,7 @@ impl PriceProvider<CurrencyId> for MockPriceSource {
fn get_relative_price(_base: CurrencyId, _quote: CurrencyId) -> Option<Price> {
Some(Price::one())
}

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

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

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


fn get_price(_currency_id: CurrencyId) -> Option<Price> {
None
}
Expand Down
15 changes: 2 additions & 13 deletions lib-serml/settmint/settmint-manager/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ impl orml_tokens::Config for Runtime {
type ExistentialDeposits = ExistentialDeposits;
type OnDust = ();
type MaxLocks = ();
type DustRemovalWhitelist = ();
}

parameter_types! {
Expand Down Expand Up @@ -178,19 +179,7 @@ impl PriceProvider<CurrencyId> for MockPriceSource {
fn get_relative_price(_base: CurrencyId, _quota: CurrencyId) -> Option<Price> {
RELATIVE_PRICE.with(|v| *v.borrow_mut())
}

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

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

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


fn get_price(_currency_id: CurrencyId) -> Option<Price> {
None
}
Expand Down
2 changes: 1 addition & 1 deletion lib-serml/support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ pub trait SerpTreasury<AccountId> {
type CurrencyId;

/// SerpUp ratio for BuyBack Swaps to burn Dinar
fn get_buyback_serpup(amount: Self::Balance, currency_id: Self::CurrencyId) -> DispatchResult;
fn get_buyback_serpup(amount: Self::Balance, currency_id: Self::CurrencyId, min_target_amount: Self::Balance) -> DispatchResult;

/// SerpUp ratio for Setheum Foundation's Charity Fund
fn get_charity_fund_serpup(amount: Self::Balance, currency_id: Self::CurrencyId) -> DispatchResult;
Expand Down
20 changes: 1 addition & 19 deletions lib-serml/tokens/currencies/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,19 +247,7 @@ impl PriceProvider<CurrencyId> for MockPriceSource {
fn get_relative_price(_base: CurrencyId, _quota: CurrencyId) -> Option<Price> {
RELATIVE_PRICE.with(|v| *v.borrow_mut())
}

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

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

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


fn get_price(_currency_id: CurrencyId) -> Option<Price> {
None
}
Expand Down Expand Up @@ -350,19 +338,13 @@ impl serp_treasury::Config for Runtime {
type SetterCurrencyId = SetterCurrencyId;
type GetSetUSDCurrencyId = GetSetUSDCurrencyId;
type DirhamCurrencyId = DirhamCurrencyId;
type SerpTesSchedule = SerpTesSchedule;
type CashDropPeriod = CashDropPeriod;
type SettPayTreasuryAccountId = SettPayTreasuryAccountId;
type CashDropVaultAccountId = CashDropVaultAccountId;
type CharityFundAccountId = CharityFundAccountId;
type Dex = SetheumDEX;
type MaxSlippageSwapWithDEX = MaxSlippageSwapWithDEX;
type PriceSource = MockPriceSource;
type RewardableCurrencyIds = RewardableCurrencyIds;
type NonStableDropCurrencyIds = StableCurrencyIds;
type SetCurrencyDropCurrencyIds = SetCurrencyDropCurrencyIds;
type MinimumClaimableTransferAmounts = MinimumClaimableTransferAmounts;
type UpdateOrigin = EnsureSignedBy<One, AccountId>;
type PalletId = SerpTreasuryPalletId;
type WeightInfo = ();
}
Expand Down
1 change: 1 addition & 0 deletions lib-serml/tokens/nft/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ impl orml_tokens::Config for Runtime {
type ExistentialDeposits = ExistentialDeposits;
type OnDust = ();
type MaxLocks = ();
type DustRemovalWhitelist = ();
}

pub const NATIVE_CURRENCY_ID: CurrencyId = CurrencyId::Token(TokenSymbol::DNAR);
Expand Down
1 change: 1 addition & 0 deletions lib-serml/transaction-payment/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ impl orml_tokens::Config for Runtime {
type ExistentialDeposits = ExistentialDeposits;
type OnDust = ();
type MaxLocks = ();
type DustRemovalWhitelist = ();
}

parameter_types! {
Expand Down
Loading

0 comments on commit f3ea87e

Please sign in to comment.