From fbe0507da942da1d3d19a030374ecdcc5ea92122 Mon Sep 17 00:00:00 2001 From: Roy Yang Date: Mon, 11 Oct 2021 21:53:00 +1300 Subject: [PATCH] Capitalized the C in Relay Chain (#1472) * Capitalized the C in Relay Chain only applied to HomaLite and relay chain related modules. Other existing modules are not affected * fixed an typo in variable name Co-authored-by: Roy Yang --- README.md | 4 +- modules/homa-lite/README.md | 4 +- modules/homa-lite/src/lib.rs | 42 +++++++++---------- modules/homa-lite/src/mock.rs | 10 ++--- modules/relaychain/src/lib.rs | 38 ++++++++--------- modules/support/src/lib.rs | 12 +++--- runtime/acala/src/lib.rs | 6 +-- runtime/common/src/lib.rs | 6 +-- .../integration-tests/src/homa_lite_tests.rs | 2 +- .../src/integration_tests.rs | 6 +-- runtime/karura/src/lib.rs | 26 ++++++------ runtime/mandala/src/lib.rs | 28 ++++++------- 12 files changed, 92 insertions(+), 92 deletions(-) diff --git a/README.md b/README.md index 62323c8128..e1f2201d84 100644 --- a/README.md +++ b/README.md @@ -187,8 +187,8 @@ cargo run --features with-mandala-runtime --features try-runtime -- try-runtime cargo run --features with-mandala-runtime --features try-runtime -- try-runtime --wasm-execution=compiled --block-at=0x9def608d5674f6d16574f53849218fe13d80ec1042ef7c2d4de7d4c50abab806 --url="wss://karura.api.onfinality.io/public-ws" offchain-worker snap -s snapshot.bin ``` -# 8. Run local testnet with `Relaychain` and `Parachain` -Build Relaychain and Parachain local testnet to develop. +# 8. Run local testnet with `RelayChain` and `Parachain` +Build RelayChain and Parachain local testnet to develop. ```bash cd launch diff --git a/modules/homa-lite/README.md b/modules/homa-lite/README.md index 295b8b149c..e476ee1547 100644 --- a/modules/homa-lite/README.md +++ b/modules/homa-lite/README.md @@ -24,11 +24,11 @@ For Karura network: * Liquid currency: LKSM ## Test -Homa-lite uses XCM transfer to upload Staking currency into the Relaychain. Therefore a setup that allows successful XCM transfer to the relaychain is required for full end-to-end test of the Homa-lite module. +Homa-lite uses XCM transfer to upload Staking currency into the RelayChain. Therefore a setup that allows successful XCM transfer to the relaychain is required for full end-to-end test of the Homa-lite module. ### Local node 1. Pull the Master branch of the Acala codebase -2. Follow the README.md to setup local Relaychain and parachains. +2. Follow the README.md to setup local RelayChain and parachains. This should launch some local test nodes running Karura(parachain) and Rococo(relaychain) 3. Open a new web browser, go to `https://polkadot.js.org/apps/#/explorer` diff --git a/modules/homa-lite/src/lib.rs b/modules/homa-lite/src/lib.rs index 22e2ae8540..1c9dd050aa 100644 --- a/modules/homa-lite/src/lib.rs +++ b/modules/homa-lite/src/lib.rs @@ -51,7 +51,7 @@ pub use weights::WeightInfo; pub mod module { use super::*; - pub type RelaychainBlockNumberOf = <::RelaychainBlockNumber as BlockNumberProvider>::BlockNumber; + pub type RelayChainBlockNumberOf = <::RelayChainBlockNumber as BlockNumberProvider>::BlockNumber; pub(crate) type AmountOf = <::Currency as MultiCurrencyExtended<::AccountId>>::Amount; @@ -88,8 +88,8 @@ pub mod module { /// The interface to Cross-chain transfer. type XcmTransfer: XcmTransfer; - /// The Call builder for communicating with Relaychain via XCM messaging. - type RelaychainCallBuilder: CallBuilder; + /// The Call builder for communicating with RelayChain via XCM messaging. + type RelayChainCallBuilder: CallBuilder; /// The MultiLocation of the sovereign sub-account for where the staking currencies are sent /// to. @@ -112,7 +112,7 @@ pub mod module { #[pallet::constant] type MintFee: Get; - /// Equivalent to the loss of % staking reward from unbonding on the Relaychain. + /// Equivalent to the loss of % staking reward from unbonding on the RelayChain. #[pallet::constant] type BaseWithdrawFee: Get; @@ -121,7 +121,7 @@ pub mod module { type XcmUnbondFee: Get; /// Block number provider for the relaychain. - type RelaychainBlockNumber: BlockNumberProvider; + type RelayChainBlockNumber: BlockNumberProvider; /// The account ID to redeem from on the relaychain. #[pallet::constant] @@ -133,7 +133,7 @@ pub mod module { /// Unbonding slashing spans for unbonding on the relaychain. #[pallet::constant] - type RelaychainUnbondingSlashingSpans: Get; + type RelayChainUnbondingSlashingSpans: Get; /// Maximum number of scheduled unbonds allowed #[pallet::constant] @@ -162,7 +162,7 @@ pub mod module { #[pallet::event] #[pallet::generate_deposit(pub(crate) fn deposit_event)] - #[pallet::metadata(T::AccountId = "AccountId", RelaychainBlockNumberOf = "RelaychainBlockNumner")] + #[pallet::metadata(T::AccountId = "AccountId", RelayChainBlockNumberOf = "RelayChainBlockNumber")] pub enum Event { /// The user has Staked some currencies to mint Liquid Currency. /// \[user, amount_staked, amount_minted\] @@ -192,12 +192,12 @@ pub mod module { /// A new Unbond request added to the schedule. /// \[staking_amount, relaychain_blocknumber\] - ScheduledUnbondAdded(Balance, RelaychainBlockNumberOf), + ScheduledUnbondAdded(Balance, RelayChainBlockNumberOf), /// The ScheduledUnbond has been replaced. ScheduledUnbondReplaced, - /// The scheduled Unbond has been withdrew from the Relaychain. + /// The scheduled Unbond has been withdrew from the RelayChain. ///\[staking_amount_added\] ScheduledUnbondWithdrew(Balance), } @@ -234,11 +234,11 @@ pub mod module { pub type AvailableStakingBalance = StorageValue<_, Balance, ValueQuery>; /// Funds that will be unbonded in the future - /// ScheduledUnbond: Vec<(staking_amount: Balance, unbond_at: RelaychainBlockNumber> + /// ScheduledUnbond: Vec<(staking_amount: Balance, unbond_at: RelayChainBlockNumber> #[pallet::storage] #[pallet::getter(fn scheduled_unbond)] pub type ScheduledUnbond = - StorageValue<_, BoundedVec<(Balance, RelaychainBlockNumberOf), T::MaxScheduledUnbonds>, ValueQuery>; + StorageValue<_, BoundedVec<(Balance, RelayChainBlockNumberOf), T::MaxScheduledUnbonds>, ValueQuery>; #[pallet::pallet] pub struct Pallet(_); @@ -252,7 +252,7 @@ pub mod module { let mut scheduled_unbond = Self::scheduled_unbond(); if !scheduled_unbond.is_empty() { let (staking_amount, block_number) = scheduled_unbond[0]; - if T::RelaychainBlockNumber::current_block_number() >= block_number { + if T::RelayChainBlockNumber::current_block_number() >= block_number { let res = Self::process_scheduled_unbond(staking_amount); log::debug!("{:?}", res); debug_assert!(res.is_ok()); @@ -492,7 +492,7 @@ pub mod module { Ok(()) } - /// Request staking currencies to be unbonded from the Relaychain. + /// Request staking currencies to be unbonded from the RelayChain. /// /// Requires `T::GovernanceOrigin` /// @@ -504,7 +504,7 @@ pub mod module { pub fn schedule_unbond( origin: OriginFor, #[pallet::compact] staking_amount: Balance, - unbond_block: RelaychainBlockNumberOf, + unbond_block: RelayChainBlockNumberOf, ) -> DispatchResult { T::GovernanceOrigin::ensure_origin(origin)?; @@ -531,7 +531,7 @@ pub mod module { #[transactional] pub fn replace_schedule_unbond( origin: OriginFor, - new_unbonds: Vec<(Balance, RelaychainBlockNumberOf)>, + new_unbonds: Vec<(Balance, RelayChainBlockNumberOf)>, ) -> DispatchResult { T::GovernanceOrigin::ensure_origin(origin)?; @@ -648,7 +648,7 @@ pub mod module { /// Mint some Liquid currency, by locking up the given amount of Staking currency. /// The redeem requests given in `requests` are prioritized to be matched. All other redeem /// requests are matched after. The remaining amount is minted through Staking on the - /// Relaychain (via XCM). + /// RelayChain (via XCM). /// /// Parameters: /// - `amount`: The amount of Staking currency to be exchanged. @@ -847,14 +847,14 @@ pub mod module { /// Construct a XCM message pub fn construct_xcm_unreserve_message(parachain_account: T::AccountId, amount: Balance) -> Xcm<()> { - let xcm_message = T::RelaychainCallBuilder::utility_as_derivative_call( - T::RelaychainCallBuilder::utility_batch_call(vec![ - T::RelaychainCallBuilder::staking_withdraw_unbonded(T::RelaychainUnbondingSlashingSpans::get()), - T::RelaychainCallBuilder::balances_transfer_keep_alive(parachain_account, amount), + let xcm_message = T::RelayChainCallBuilder::utility_as_derivative_call( + T::RelayChainCallBuilder::utility_batch_call(vec![ + T::RelayChainCallBuilder::staking_withdraw_unbonded(T::RelayChainUnbondingSlashingSpans::get()), + T::RelayChainCallBuilder::balances_transfer_keep_alive(parachain_account, amount), ]), T::SubAccountIndex::get(), ); - T::RelaychainCallBuilder::finalize_call_into_xcm_message( + T::RelayChainCallBuilder::finalize_call_into_xcm_message( xcm_message, T::XcmUnbondFee::get(), Self::xcm_dest_weight(), diff --git a/modules/homa-lite/src/mock.rs b/modules/homa-lite/src/mock.rs index 48810cb198..ae1a089ffb 100644 --- a/modules/homa-lite/src/mock.rs +++ b/modules/homa-lite/src/mock.rs @@ -23,7 +23,7 @@ pub use super::*; pub use frame_support::{ord_parameter_types, parameter_types, traits::Everything}; pub use frame_system::{EnsureRoot, EnsureSignedBy, RawOrigin}; -pub use module_relaychain::RelaychainCallBuilder; +pub use module_relaychain::RelayChainCallBuilder; pub use module_support::mocks::MockAddressMapping; pub use orml_traits::{parameter_type_with_key, XcmTransfer}; pub use primitives::{Amount, TokenSymbol}; @@ -258,7 +258,7 @@ parameter_types! { pub const ParachainAccount: AccountId = ROOT; pub const MaximumRedeemRequestMatchesForMint: u32 = 2; pub static MockRelayBlockNumberProvider: u64 = 0; - pub const RelaychainUnbondingSlashingSpans: u32 = 5; + pub const RelayChainUnbondingSlashingSpans: u32 = 5; pub const MaxScheduledUnbonds: u32 = 14; pub const SubAccountIndex: u16 = 0; pub ParachainId: ParaId = ParaId::from(PARACHAIN_ID); @@ -290,13 +290,13 @@ impl Config for Runtime { type DefaultExchangeRate = DefaultExchangeRate; type MaxRewardPerEra = MaxRewardPerEra; type MintFee = MintFee; - type RelaychainCallBuilder = RelaychainCallBuilder; + type RelayChainCallBuilder = RelayChainCallBuilder; type BaseWithdrawFee = BaseWithdrawFee; type XcmUnbondFee = XcmUnbondFee; - type RelaychainBlockNumber = MockRelayBlockNumberProvider; + type RelayChainBlockNumber = MockRelayBlockNumberProvider; type ParachainAccount = ParachainAccount; type MaximumRedeemRequestMatchesForMint = MaximumRedeemRequestMatchesForMint; - type RelaychainUnbondingSlashingSpans = RelaychainUnbondingSlashingSpans; + type RelayChainUnbondingSlashingSpans = RelayChainUnbondingSlashingSpans; type MaxScheduledUnbonds = MaxScheduledUnbonds; } diff --git a/modules/relaychain/src/lib.rs b/modules/relaychain/src/lib.rs index bdc673ae91..bc7d861053 100644 --- a/modules/relaychain/src/lib.rs +++ b/modules/relaychain/src/lib.rs @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -//! # Module Relaychain +//! # Module RelayChain //! //! This module is in charge of handling relaychain related utilities and business logic. @@ -43,11 +43,11 @@ pub enum BalancesCall { } #[derive(Encode, Decode, RuntimeDebug)] -pub enum UtilityCall { +pub enum UtilityCall { #[codec(index = 1)] - AsDerivative(u16, RelaychainCall), + AsDerivative(u16, RelayChainCall), #[codec(index = 2)] - BatchAll(Vec), + BatchAll(Vec), } #[derive(Encode, Decode, RuntimeDebug)] @@ -62,7 +62,7 @@ mod kusama { /// The encoded index correspondes to Kusama's Runtime module configuration. /// https://github.com/paritytech/polkadot/blob/444e96ae34bcec8362f0f947a07bd912b32ca48f/runtime/kusama/src/lib.rs#L1379 #[derive(Encode, Decode, RuntimeDebug)] - pub enum RelaychainCall { + pub enum RelayChainCall { #[codec(index = 4)] Balances(BalancesCall), #[codec(index = 6)] @@ -78,7 +78,7 @@ mod polkadot { /// The encoded index correspondes to Polkadot's Runtime module configuration. /// https://github.com/paritytech/polkadot/blob/84a3962e76151ac5ed3afa4ef1e0af829531ab42/runtime/polkadot/src/lib.rs#L1040 #[derive(Encode, Decode, RuntimeDebug)] - pub enum RelaychainCall { + pub enum RelayChainCall { #[codec(index = 5)] Balances(BalancesCall), #[codec(index = 7)] @@ -94,35 +94,35 @@ pub use kusama::*; #[cfg(feature = "polkadot")] pub use polkadot::*; -pub struct RelaychainCallBuilder>(PhantomData<(T, ParachainId)>); +pub struct RelayChainCallBuilder>(PhantomData<(T, ParachainId)>); -impl> CallBuilder for RelaychainCallBuilder +impl> CallBuilder for RelayChainCallBuilder where T::AccountId: FullCodec, - RelaychainCall: FullCodec, + RelayChainCall: FullCodec, { type AccountId = T::AccountId; type Balance = Balance; - type RelaychainCall = RelaychainCall; + type RelayChainCall = RelayChainCall; - fn utility_batch_call(calls: Vec) -> Self::RelaychainCall { - RelaychainCall::Utility(Box::new(UtilityCall::BatchAll(calls))) + fn utility_batch_call(calls: Vec) -> Self::RelayChainCall { + RelayChainCall::Utility(Box::new(UtilityCall::BatchAll(calls))) } - fn utility_as_derivative_call(call: Self::RelaychainCall, index: u16) -> Self::RelaychainCall { - RelaychainCall::Utility(Box::new(UtilityCall::AsDerivative(index, call))) + fn utility_as_derivative_call(call: Self::RelayChainCall, index: u16) -> Self::RelayChainCall { + RelayChainCall::Utility(Box::new(UtilityCall::AsDerivative(index, call))) } - fn staking_withdraw_unbonded(num_slashing_spans: u32) -> Self::RelaychainCall { - RelaychainCall::Staking(StakingCall::WithdrawUnbonded(num_slashing_spans)) + fn staking_withdraw_unbonded(num_slashing_spans: u32) -> Self::RelayChainCall { + RelayChainCall::Staking(StakingCall::WithdrawUnbonded(num_slashing_spans)) } - fn balances_transfer_keep_alive(to: Self::AccountId, amount: Self::Balance) -> Self::RelaychainCall { - RelaychainCall::Balances(BalancesCall::TransferKeepAlive(T::Lookup::unlookup(to), amount)) + fn balances_transfer_keep_alive(to: Self::AccountId, amount: Self::Balance) -> Self::RelayChainCall { + RelayChainCall::Balances(BalancesCall::TransferKeepAlive(T::Lookup::unlookup(to), amount)) } fn finalize_call_into_xcm_message( - call: Self::RelaychainCall, + call: Self::RelayChainCall, extra_fee: Self::Balance, weight: Weight, debt: Weight, diff --git a/modules/support/src/lib.rs b/modules/support/src/lib.rs index c8e829d72c..4d0ba94ebd 100644 --- a/modules/support/src/lib.rs +++ b/modules/support/src/lib.rs @@ -568,29 +568,29 @@ pub trait CompoundCashTrait { pub trait CallBuilder { type AccountId: FullCodec; type Balance: FullCodec; - type RelaychainCall: FullCodec; + type RelayChainCall: FullCodec; /// Execute multiple calls in a batch. /// Param: /// - calls: List of calls to be executed - fn utility_batch_call(calls: Vec) -> Self::RelaychainCall; + fn utility_batch_call(calls: Vec) -> Self::RelayChainCall; /// Execute a call, replacing the `Origin` with a sub-account. /// params: /// - call: The call to be executed. Can be nested with `utility_batch_call` /// - index: The index of sub-account to be used as the new origin. - fn utility_as_derivative_call(call: Self::RelaychainCall, index: u16) -> Self::RelaychainCall; + fn utility_as_derivative_call(call: Self::RelayChainCall, index: u16) -> Self::RelayChainCall; /// Withdraw unbonded staking on the relay-chain. /// params: /// - num_slashing_spans: The number of slashing spans to withdraw from. - fn staking_withdraw_unbonded(num_slashing_spans: u32) -> Self::RelaychainCall; + fn staking_withdraw_unbonded(num_slashing_spans: u32) -> Self::RelayChainCall; /// Transfer Staking currency to another account, disallowing "death". /// params: /// - to: The destination for the transfer /// - amount: The amount of staking currency to be transferred. - fn balances_transfer_keep_alive(to: Self::AccountId, amount: Self::Balance) -> Self::RelaychainCall; + fn balances_transfer_keep_alive(to: Self::AccountId, amount: Self::Balance) -> Self::RelayChainCall; /// Wrap the final calls into the Xcm format. /// params: @@ -599,7 +599,7 @@ pub trait CallBuilder { /// - weight: the weight limit used for XCM. /// - debt: the weight limit used to process the `call`. fn finalize_call_into_xcm_message( - call: Self::RelaychainCall, + call: Self::RelayChainCall, extra_fee: Self::Balance, weight: Weight, debt: Weight, diff --git a/runtime/acala/src/lib.rs b/runtime/acala/src/lib.rs index bfcfa92382..bfef2f847d 100644 --- a/runtime/acala/src/lib.rs +++ b/runtime/acala/src/lib.rs @@ -107,7 +107,7 @@ pub use runtime_common::{ EnsureRootOrTwoThirdsTechnicalCommittee, ExchangeRate, FinancialCouncilInstance, FinancialCouncilMembershipInstance, GasToWeight, GeneralCouncilInstance, GeneralCouncilMembershipInstance, HomaCouncilInstance, HomaCouncilMembershipInstance, OffchainSolutionWeightLimit, OperatorMembershipInstanceAcala, - OperatorMembershipInstanceBand, Price, ProxyType, Rate, Ratio, RelaychainBlockNumberProvider, RuntimeBlockLength, + OperatorMembershipInstanceBand, Price, ProxyType, Rate, Ratio, RelayChainBlockNumberProvider, RuntimeBlockLength, RuntimeBlockWeights, SystemContractsFilter, TechnicalCommitteeInstance, TechnicalCommitteeMembershipInstance, TimeStampedPrice, ACA, AUSD, DOT, LDOT, RENBTC, }; @@ -862,7 +862,7 @@ impl orml_vesting::Config for Runtime { type VestedTransferOrigin = EnsureRootOrTreasury; type WeightInfo = weights::orml_vesting::WeightInfo; type MaxVestingSchedules = MaxVestingSchedules; - type BlockNumberProvider = RelaychainBlockNumberProvider; + type BlockNumberProvider = RelayChainBlockNumberProvider; } parameter_types! { @@ -1221,7 +1221,7 @@ impl module_homa_validator_list::Config for Runtime { type WeightInfo = (); type OnIncreaseGuarantee = (); type OnDecreaseGuarantee = (); - type BlockNumberProvider = RelaychainBlockNumberProvider; + type BlockNumberProvider = RelayChainBlockNumberProvider; } parameter_types! { diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index 19b48a75a0..70029f1c4a 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -169,9 +169,9 @@ pub fn microcent(currency_id: CurrencyId) -> Balance { millicent(currency_id) / 1000 } -pub struct RelaychainBlockNumberProvider(sp_std::marker::PhantomData); +pub struct RelayChainBlockNumberProvider(sp_std::marker::PhantomData); -impl BlockNumberProvider for RelaychainBlockNumberProvider { +impl BlockNumberProvider for RelayChainBlockNumberProvider { type BlockNumber = BlockNumber; fn current_block_number() -> Self::BlockNumber { @@ -337,7 +337,7 @@ impl Default for ProxyType { } #[repr(u16)] -pub enum RelaychainSubAccountId { +pub enum RelayChainSubAccountId { HomaLite = 0, } diff --git a/runtime/integration-tests/src/homa_lite_tests.rs b/runtime/integration-tests/src/homa_lite_tests.rs index 0b8ffbd484..b0402c3667 100644 --- a/runtime/integration-tests/src/homa_lite_tests.rs +++ b/runtime/integration-tests/src/homa_lite_tests.rs @@ -380,7 +380,7 @@ mod karura_only_tests { set_relaychain_block_number(101_000); run_to_block(5); assert_eq!( - RelaychainBlockNumberProvider::::current_block_number(), + RelayChainBlockNumberProvider::::current_block_number(), 101_000 ); HomaLite::on_idle(5, 1_000_000_000); diff --git a/runtime/integration-tests/src/integration_tests.rs b/runtime/integration-tests/src/integration_tests.rs index 754ba8d5f6..3e3f27bdeb 100644 --- a/runtime/integration-tests/src/integration_tests.rs +++ b/runtime/integration-tests/src/integration_tests.rs @@ -54,7 +54,7 @@ mod mandala_imports { EnabledTradingPairs, Event, EvmAccounts, ExistentialDeposits, Get, GetNativeCurrencyId, HomaLite, Honzon, Loans, MinimumDebitValue, MultiLocation, NativeTokenExistentialDeposit, NetworkId, NftPalletId, OneDay, Origin, OriginCaller, ParachainInfo, ParachainSystem, Perbill, Permill, Proxy, ProxyType, - RelaychainSovereignSubAccount, Runtime, Scheduler, Session, SessionManager, SevenDays, System, Timestamp, + RelayChainSovereignSubAccount, Runtime, Scheduler, Session, SessionManager, SevenDays, System, Timestamp, TokenSymbol, Tokens, TreasuryAccount, TreasuryPalletId, Utility, Vesting, XcmConfig, XcmExecutor, NFT, }; @@ -81,7 +81,7 @@ mod karura_imports { EmergencyShutdown, Event, EvmAccounts, ExistentialDeposits, Get, GetNativeCurrencyId, HomaLite, Honzon, KaruraFoundationAccounts, Loans, MinimumDebitValue, MultiLocation, NativeTokenExistentialDeposit, NetworkId, NftPalletId, OneDay, Origin, OriginCaller, ParachainAccount, ParachainInfo, ParachainSystem, Perbill, Permill, - Proxy, ProxyType, RelaychainBlockNumberProvider, RelaychainSovereignSubAccount, Runtime, Scheduler, Session, + Proxy, ProxyType, RelayChainBlockNumberProvider, RelayChainSovereignSubAccount, Runtime, Scheduler, Session, SessionManager, SevenDays, System, Timestamp, TokenSymbol, Tokens, TreasuryPalletId, Utility, Vesting, XTokens, XcmConfig, XcmExecutor, NFT, }; @@ -1602,7 +1602,7 @@ fn parachain_subaccounts_are_unique() { ); assert_eq!( - RelaychainSovereignSubAccount::get(), + RelayChainSovereignSubAccount::get(), create_x2_parachain_multilocation(0) ); diff --git a/runtime/karura/src/lib.rs b/runtime/karura/src/lib.rs index f0b4272685..87b8b01c1d 100644 --- a/runtime/karura/src/lib.rs +++ b/runtime/karura/src/lib.rs @@ -56,7 +56,7 @@ use module_evm::Runner; use module_evm::{CallInfo, CreateInfo}; use module_evm_accounts::EvmAddressMapping; use module_evm_manager::EvmCurrencyIdMapping; -use module_relaychain::RelaychainCallBuilder; +use module_relaychain::RelayChainCallBuilder; use module_transaction_payment::{Multiplier, TargetedFeeAdjustment}; use orml_traits::{ create_median_value_data_provider, parameter_type_with_key, DataFeeder, DataProviderExtended, MultiCurrency, @@ -112,8 +112,8 @@ pub use runtime_common::{ EnsureRootOrTwoThirdsTechnicalCommittee, ExchangeRate, FinancialCouncilInstance, FinancialCouncilMembershipInstance, GasToWeight, GeneralCouncilInstance, GeneralCouncilMembershipInstance, HomaCouncilInstance, HomaCouncilMembershipInstance, OperatorMembershipInstanceAcala, - OperatorMembershipInstanceBand, Price, ProxyType, Rate, Ratio, RelaychainBlockNumberProvider, - RelaychainSubAccountId, RuntimeBlockLength, RuntimeBlockWeights, SystemContractsFilter, TechnicalCommitteeInstance, + OperatorMembershipInstanceBand, Price, ProxyType, Rate, Ratio, RelayChainBlockNumberProvider, + RelayChainSubAccountId, RuntimeBlockLength, RuntimeBlockWeights, SystemContractsFilter, TechnicalCommitteeInstance, TechnicalCommitteeMembershipInstance, TimeStampedPrice, BNC, KAR, KSM, KUSD, LKSM, RENBTC, VSKSM, }; @@ -869,7 +869,7 @@ impl orml_vesting::Config for Runtime { type VestedTransferOrigin = EnsureKaruraFoundation; type WeightInfo = weights::orml_vesting::WeightInfo; type MaxVestingSchedules = MaxVestingSchedules; - type BlockNumberProvider = RelaychainBlockNumberProvider; + type BlockNumberProvider = RelayChainBlockNumberProvider; } parameter_types! { @@ -1533,20 +1533,20 @@ parameter_types! { pub const LKSMCurrencyId: CurrencyId = CurrencyId::Token(TokenSymbol::LKSM); pub MinimumMintThreshold: Balance = 10 * cent(KSM); pub MinimumRedeemThreshold: Balance = 100 * cent(LKSM); - pub RelaychainSovereignSubAccount: MultiLocation = create_x2_parachain_multilocation(RelaychainSubAccountId::HomaLite as u16); - pub RelaychainSovereignSubAccountId: AccountId = Utility::derivative_account_id( + pub RelayChainSovereignSubAccount: MultiLocation = create_x2_parachain_multilocation(RelayChainSubAccountId::HomaLite as u16); + pub RelayChainSovereignSubAccountId: AccountId = Utility::derivative_account_id( ParachainInfo::get().into_account(), - RelaychainSubAccountId::HomaLite as u16 + RelayChainSubAccountId::HomaLite as u16 ); pub MaxRewardPerEra: Permill = Permill::from_rational(500u32, 1_000_000u32); // 1.2 ^ (1/365) = 1.0004996359 pub MintFee: Balance = 20 * millicent(KSM); // 2x XCM fee on Kusama pub DefaultExchangeRate: ExchangeRate = ExchangeRate::saturating_from_rational(1, 10); pub BaseWithdrawFee: Permill = Permill::from_rational(35u32, 10_000u32); // 20% yield per year, unbonding period = 7 days. 1.2^(7 / 365) = 1.00350 pub MaximumRedeemRequestMatchesForMint: u32 = 20; - pub RelaychainUnbondingSlashingSpans: u32 = 5; + pub RelayChainUnbondingSlashingSpans: u32 = 5; pub MaxScheduledUnbonds: u32 = 14; pub ParachainAccount: AccountId = ParachainInfo::get().into_account(); - pub SubAccountIndex: u16 = RelaychainSubAccountId::HomaLite as u16; + pub SubAccountIndex: u16 = RelayChainSubAccountId::HomaLite as u16; pub const XcmUnbondFee: Balance = 600_000_000; // From homa-lite integration test. } impl module_homa_lite::Config for Runtime { @@ -1559,18 +1559,18 @@ impl module_homa_lite::Config for Runtime { type MinimumMintThreshold = MinimumMintThreshold; type MinimumRedeemThreshold = MinimumRedeemThreshold; type XcmTransfer = XTokens; - type SovereignSubAccountLocation = RelaychainSovereignSubAccount; + type SovereignSubAccountLocation = RelayChainSovereignSubAccount; type SubAccountIndex = SubAccountIndex; type DefaultExchangeRate = DefaultExchangeRate; type MaxRewardPerEra = MaxRewardPerEra; type MintFee = MintFee; - type RelaychainCallBuilder = RelaychainCallBuilder; + type RelayChainCallBuilder = RelayChainCallBuilder; type BaseWithdrawFee = BaseWithdrawFee; type XcmUnbondFee = XcmUnbondFee; - type RelaychainBlockNumber = RelaychainBlockNumberProvider; + type RelayChainBlockNumber = RelayChainBlockNumberProvider; type ParachainAccount = ParachainAccount; type MaximumRedeemRequestMatchesForMint = MaximumRedeemRequestMatchesForMint; - type RelaychainUnbondingSlashingSpans = RelaychainUnbondingSlashingSpans; + type RelayChainUnbondingSlashingSpans = RelayChainUnbondingSlashingSpans; type MaxScheduledUnbonds = MaxScheduledUnbonds; } diff --git a/runtime/mandala/src/lib.rs b/runtime/mandala/src/lib.rs index 0b7f2bd20b..6280cb387a 100644 --- a/runtime/mandala/src/lib.rs +++ b/runtime/mandala/src/lib.rs @@ -54,7 +54,7 @@ use module_evm::Runner; use module_evm::{CallInfo, CreateInfo}; use module_evm_accounts::EvmAddressMapping; pub use module_evm_manager::EvmCurrencyIdMapping; -use module_relaychain::RelaychainCallBuilder; +use module_relaychain::RelayChainCallBuilder; use module_transaction_payment::{Multiplier, TargetedFeeAdjustment}; use orml_tokens::CurrencyAdapter; use orml_traits::{ @@ -116,8 +116,8 @@ pub use runtime_common::{ EnsureRootOrTwoThirdsTechnicalCommittee, ExchangeRate, FinancialCouncilInstance, FinancialCouncilMembershipInstance, GasToWeight, GeneralCouncilInstance, GeneralCouncilMembershipInstance, HomaCouncilInstance, HomaCouncilMembershipInstance, OffchainSolutionWeightLimit, OperatorMembershipInstanceAcala, - OperatorMembershipInstanceBand, Price, ProxyType, Rate, Ratio, RelaychainBlockNumberProvider, - RelaychainSubAccountId, RuntimeBlockLength, RuntimeBlockWeights, SystemContractsFilter, TechnicalCommitteeInstance, + OperatorMembershipInstanceBand, Price, ProxyType, Rate, Ratio, RelayChainBlockNumberProvider, + RelayChainSubAccountId, RuntimeBlockLength, RuntimeBlockWeights, SystemContractsFilter, TechnicalCommitteeInstance, TechnicalCommitteeMembershipInstance, TimeStampedPrice, ACA, AUSD, DOT, LDOT, RENBTC, }; @@ -916,7 +916,7 @@ impl orml_vesting::Config for Runtime { type VestedTransferOrigin = EnsureRootOrTreasury; type WeightInfo = weights::orml_vesting::WeightInfo; type MaxVestingSchedules = MaxVestingSchedules; - type BlockNumberProvider = RelaychainBlockNumberProvider; + type BlockNumberProvider = RelayChainBlockNumberProvider; } parameter_types! { @@ -1265,19 +1265,19 @@ pub fn create_x2_parachain_multilocation(index: u16) -> MultiLocation { parameter_types! { pub MinimumMintThreshold: Balance = 10 * cent(DOT); pub MinimumRedeemThreshold: Balance = 100 * cent(LDOT); - pub RelaychainSovereignSubAccount: MultiLocation = create_x2_parachain_multilocation(RelaychainSubAccountId::HomaLite as u16); - pub RelaychainSovereignSubAccountId: AccountId = Utility::derivative_account_id( + pub RelayChainSovereignSubAccount: MultiLocation = create_x2_parachain_multilocation(RelayChainSubAccountId::HomaLite as u16); + pub RelayChainSovereignSubAccountId: AccountId = Utility::derivative_account_id( ParachainInfo::get().into_account(), - RelaychainSubAccountId::HomaLite as u16 + RelayChainSubAccountId::HomaLite as u16 ); pub MaxRewardPerEra: Permill = Permill::from_rational(500u32, 1_000_000u32); // 1.2 ^ (1/365) = 1.0004996359 pub MintFee: Balance = millicent(DOT); pub BaseWithdrawFee: Permill = Permill::from_rational(14_085u32, 1_000_000u32); // 20% yield per year, unbounding period = 28 days. 1.2^(28/365) = 1.014085 pub MaximumRedeemRequestMatchesForMint: u32 = 20; - pub RelaychainUnbondingSlashingSpans: u32 = 5; + pub RelayChainUnbondingSlashingSpans: u32 = 5; pub MaxScheduledUnbonds: u32 = 35; pub ParachainAccount: AccountId = ParachainInfo::get().into_account(); - pub SubAccountIndex: u16 = RelaychainSubAccountId::HomaLite as u16; + pub SubAccountIndex: u16 = RelayChainSubAccountId::HomaLite as u16; pub const XcmUnbondFee: Balance = 600_000_000; // From homa-lite integration test. } impl module_homa_lite::Config for Runtime { @@ -1290,18 +1290,18 @@ impl module_homa_lite::Config for Runtime { type MinimumMintThreshold = MinimumMintThreshold; type MinimumRedeemThreshold = MinimumRedeemThreshold; type XcmTransfer = XTokens; - type SovereignSubAccountLocation = RelaychainSovereignSubAccount; + type SovereignSubAccountLocation = RelayChainSovereignSubAccount; type SubAccountIndex = SubAccountIndex; type DefaultExchangeRate = DefaultExchangeRate; type MaxRewardPerEra = MaxRewardPerEra; type MintFee = MintFee; - type RelaychainCallBuilder = RelaychainCallBuilder; + type RelayChainCallBuilder = RelayChainCallBuilder; type BaseWithdrawFee = BaseWithdrawFee; type XcmUnbondFee = XcmUnbondFee; - type RelaychainBlockNumber = RelaychainBlockNumberProvider; + type RelayChainBlockNumber = RelayChainBlockNumberProvider; type ParachainAccount = ParachainAccount; type MaximumRedeemRequestMatchesForMint = MaximumRedeemRequestMatchesForMint; - type RelaychainUnbondingSlashingSpans = RelaychainUnbondingSlashingSpans; + type RelayChainUnbondingSlashingSpans = RelayChainUnbondingSlashingSpans; type MaxScheduledUnbonds = MaxScheduledUnbonds; } @@ -1344,7 +1344,7 @@ impl module_homa_validator_list::Config for Runtime { type WeightInfo = (); type OnIncreaseGuarantee = (); type OnDecreaseGuarantee = (); - type BlockNumberProvider = RelaychainBlockNumberProvider; + type BlockNumberProvider = RelayChainBlockNumberProvider; } parameter_types! {