From a355a728e25c0e4117f10a13719ba350fa6bd6be Mon Sep 17 00:00:00 2001 From: Frank Yin Date: Sun, 19 Dec 2021 17:44:42 -0800 Subject: [PATCH 1/6] mandala deployment --- primitives/src/currency.rs | 1 + runtime/acala/src/lib.rs | 1 + runtime/karura/src/lib.rs | 1 + runtime/mandala/src/lib.rs | 5 +++-- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/primitives/src/currency.rs b/primitives/src/currency.rs index 8a2a73b7c3..059cb0397f 100644 --- a/primitives/src/currency.rs +++ b/primitives/src/currency.rs @@ -184,6 +184,7 @@ create_currency_id! { AUSD("Acala Dollar", 12) = 1, DOT("Polkadot", 10) = 2, LDOT("Liquid DOT", 10) = 3, + TAI("Taiga", 12) = 4, // 20 - 39: External tokens (e.g. bridged) RENBTC("Ren Protocol BTC", 8) = 20, CASH("Compound CASH", 8) = 21, diff --git a/runtime/acala/src/lib.rs b/runtime/acala/src/lib.rs index 20df39c8a1..e0c9d5c676 100644 --- a/runtime/acala/src/lib.rs +++ b/runtime/acala/src/lib.rs @@ -751,6 +751,7 @@ parameter_type_with_key! { TokenSymbol::ACA | TokenSymbol::KBTC | TokenSymbol::KINT | + TokenSymbol::TAI | TokenSymbol::CASH => Balance::max_value() // unsupported }, CurrencyId::DexShare(dex_share_0, _) => { diff --git a/runtime/karura/src/lib.rs b/runtime/karura/src/lib.rs index a89930423f..1fb9348e34 100644 --- a/runtime/karura/src/lib.rs +++ b/runtime/karura/src/lib.rs @@ -754,6 +754,7 @@ parameter_type_with_key! { TokenSymbol::PHA => 4000 * millicent(*currency_id), // 400PHA = 1KSM TokenSymbol::KINT => 13333 * microcent(*currency_id), // 1.33 KINT = 1 KSM TokenSymbol::KBTC => 66 * microcent(*currency_id), // 1KBTC = 150 KSM + TokenSymbol::KAI => 10 * millicent(*currency_id), TokenSymbol::ACA | TokenSymbol::AUSD | diff --git a/runtime/mandala/src/lib.rs b/runtime/mandala/src/lib.rs index 51d7812325..af1af7c3bb 100644 --- a/runtime/mandala/src/lib.rs +++ b/runtime/mandala/src/lib.rs @@ -789,7 +789,8 @@ parameter_type_with_key! { TokenSymbol::ACA | TokenSymbol::KINT | TokenSymbol::KBTC | - TokenSymbol::CASH => Balance::max_value() // unsupported + TokenSymbol::TAI | + TokenSymbol::CASH => 10 * millicent(*currency_id) // unsupported }, CurrencyId::DexShare(dex_share_0, _) => { let currency_id_0: CurrencyId = (*dex_share_0).into(); @@ -1022,7 +1023,7 @@ where } parameter_types! { - pub CollateralCurrencyIds: Vec = vec![DOT, LDOT, RENBTC]; + pub CollateralCurrencyIds: Vec = vec![DOT, LDOT, RENBTC, CurrencyId::StableAssetPoolToken(0)]; pub DefaultLiquidationRatio: Ratio = Ratio::saturating_from_rational(110, 100); pub DefaultDebitExchangeRate: ExchangeRate = ExchangeRate::saturating_from_rational(1, 10); pub DefaultLiquidationPenalty: Rate = Rate::saturating_from_rational(5, 100); From 3fa74f003e0ae07d17a152f0cbef2c5f8610f40e Mon Sep 17 00:00:00 2001 From: Frank Yin Date: Sun, 19 Dec 2021 17:53:41 -0800 Subject: [PATCH 2/6] Update runtime/mandala/src/lib.rs Co-authored-by: Xiliang Chen --- runtime/mandala/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/mandala/src/lib.rs b/runtime/mandala/src/lib.rs index af1af7c3bb..b1566444de 100644 --- a/runtime/mandala/src/lib.rs +++ b/runtime/mandala/src/lib.rs @@ -790,7 +790,7 @@ parameter_type_with_key! { TokenSymbol::KINT | TokenSymbol::KBTC | TokenSymbol::TAI | - TokenSymbol::CASH => 10 * millicent(*currency_id) // unsupported + TokenSymbol::CASH => 10 * millicent(*currency_id) }, CurrencyId::DexShare(dex_share_0, _) => { let currency_id_0: CurrencyId = (*dex_share_0).into(); From eebe92279301613cefda64c381852cd8f1e8cb9d Mon Sep 17 00:00:00 2001 From: Frank Yin Date: Sun, 19 Dec 2021 17:56:18 -0800 Subject: [PATCH 3/6] address code review comments --- primitives/src/currency.rs | 2 +- runtime/karura/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/primitives/src/currency.rs b/primitives/src/currency.rs index 059cb0397f..0c646f3fe8 100644 --- a/primitives/src/currency.rs +++ b/primitives/src/currency.rs @@ -184,7 +184,6 @@ create_currency_id! { AUSD("Acala Dollar", 12) = 1, DOT("Polkadot", 10) = 2, LDOT("Liquid DOT", 10) = 3, - TAI("Taiga", 12) = 4, // 20 - 39: External tokens (e.g. bridged) RENBTC("Ren Protocol BTC", 8) = 20, CASH("Compound CASH", 8) = 21, @@ -195,6 +194,7 @@ create_currency_id! { KUSD("Karura Dollar", 12) = 129, KSM("Kusama", 12) = 130, LKSM("Liquid KSM", 12) = 131, + TAI("Taiga", 12) = 132, // 148 - 167: External tokens (e.g. bridged) // 149: Reserved for renBTC // 150: Reserved for CASH diff --git a/runtime/karura/src/lib.rs b/runtime/karura/src/lib.rs index 1fb9348e34..2f112ef4f1 100644 --- a/runtime/karura/src/lib.rs +++ b/runtime/karura/src/lib.rs @@ -754,13 +754,13 @@ parameter_type_with_key! { TokenSymbol::PHA => 4000 * millicent(*currency_id), // 400PHA = 1KSM TokenSymbol::KINT => 13333 * microcent(*currency_id), // 1.33 KINT = 1 KSM TokenSymbol::KBTC => 66 * microcent(*currency_id), // 1KBTC = 150 KSM - TokenSymbol::KAI => 10 * millicent(*currency_id), TokenSymbol::ACA | TokenSymbol::AUSD | TokenSymbol::DOT | TokenSymbol::LDOT | TokenSymbol::RENBTC | + TokenSymbol::KAI | TokenSymbol::KAR | TokenSymbol::CASH => Balance::max_value() // unsupported }, From abcf1a603bbb28cb11f97fe8ca2b0a25f3041b38 Mon Sep 17 00:00:00 2001 From: Frank Yin Date: Sun, 19 Dec 2021 18:04:10 -0800 Subject: [PATCH 4/6] Update runtime/karura/src/lib.rs Co-authored-by: Xiliang Chen --- runtime/karura/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/karura/src/lib.rs b/runtime/karura/src/lib.rs index 2f112ef4f1..cc851d877a 100644 --- a/runtime/karura/src/lib.rs +++ b/runtime/karura/src/lib.rs @@ -760,7 +760,7 @@ parameter_type_with_key! { TokenSymbol::DOT | TokenSymbol::LDOT | TokenSymbol::RENBTC | - TokenSymbol::KAI | + TokenSymbol::TAI | TokenSymbol::KAR | TokenSymbol::CASH => Balance::max_value() // unsupported }, From fcd5978e54147fd2e00aa3746e6d61c89d99a0dd Mon Sep 17 00:00:00 2001 From: Bryan Chen Date: Mon, 20 Dec 2021 15:53:48 +1300 Subject: [PATCH 5/6] fix test --- runtime/integration-tests/src/runtime.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/integration-tests/src/runtime.rs b/runtime/integration-tests/src/runtime.rs index f5d1de0dbf..11afb8f3cc 100644 --- a/runtime/integration-tests/src/runtime.rs +++ b/runtime/integration-tests/src/runtime.rs @@ -392,7 +392,7 @@ mod mandala_only_tests { // tips = 0 // operational extrinsic - let call = Call::Sudo(pallet_sudo::Call::sudo { call: Box::new(module_emergency_shutdown::Call::emergency_shutdown { }.into()) }); + let call = Call::Sudo(pallet_sudo::Call::sudo { call: Box::new(module_emergency_shutdown::Call::open_collateral_refund { }.into()) }); let bytes = UncheckedExtrinsic::new(call.clone().into(), None).expect("This should not fail").encode(); assert_eq!( @@ -403,7 +403,7 @@ mod mandala_only_tests { bytes.len() ), Ok(ValidTransaction { - priority: 43_824_742_400_000_000, + priority: 64_296_718_080_000_000, requires: vec![], provides: vec![], longevity: 18_446_744_073_709_551_615, From 2bfc1fc20b36ce739b39699863b1377cb0650f1f Mon Sep 17 00:00:00 2001 From: Bryan Chen Date: Mon, 20 Dec 2021 15:59:09 +1300 Subject: [PATCH 6/6] update enabled assets for mandala --- runtime/mandala/src/lib.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/runtime/mandala/src/lib.rs b/runtime/mandala/src/lib.rs index b1566444de..7860ff9a2d 100644 --- a/runtime/mandala/src/lib.rs +++ b/runtime/mandala/src/lib.rs @@ -780,17 +780,16 @@ parameter_type_with_key! { TokenSymbol::BNC => 800 * millicent(*currency_id), // 80BNC = 1KSM TokenSymbol::VSKSM => 10 * millicent(*currency_id), // 1VSKSM = 1KSM TokenSymbol::PHA => 4000 * millicent(*currency_id), // 400PHA = 1KSM - - TokenSymbol::KAR | TokenSymbol::KUSD | TokenSymbol::KSM | TokenSymbol::LKSM | TokenSymbol::RENBTC | - TokenSymbol::ACA | TokenSymbol::KINT | TokenSymbol::KBTC | - TokenSymbol::TAI | - TokenSymbol::CASH => 10 * millicent(*currency_id) + TokenSymbol::TAI => 10 * millicent(*currency_id), + TokenSymbol::ACA | + TokenSymbol::KAR | + TokenSymbol::CASH => Balance::max_value() // unsupported }, CurrencyId::DexShare(dex_share_0, _) => { let currency_id_0: CurrencyId = (*dex_share_0).into();