Runtime lib restructure (#202)

* impl apis exported

* runtime version test moved to constants

* constants exported

* constant related errors fixed

* pallet configs exported

* xmc_config moved to configs

* types extracted
This commit is contained in:
Özgün Özerk
2024-05-31 20:06:18 +03:00
committed by GitHub
parent 64d64b88d0
commit dc4f0129f1
26 changed files with 2608 additions and 2442 deletions
+26 -2
View File
@@ -20,9 +20,33 @@ mod constant_tests {
mod runtime_tests {
use frame_support::{pallet_prelude::Weight, traits::TypedGet, PalletId};
use parachain_template_runtime::{constants::currency::*, *};
use parachain_template_runtime::{
configs::*,
constants::{currency::*, *},
*,
};
use sp_runtime::create_runtime_str;
use sp_version::RuntimeVersion;
use xcm::latest::prelude::BodyId;
// RUNTIME_API_VERSIONS constant is generated by a macro and is private.
#[test]
fn check_version() {
assert_eq!(
VERSION,
RuntimeVersion {
spec_name: create_runtime_str!("template-parachain"),
impl_name: create_runtime_str!("template-parachain"),
authoring_version: 1,
spec_version: 1,
impl_version: 0,
apis: parachain_template_runtime::apis::RUNTIME_API_VERSIONS,
transaction_version: 1,
state_version: 1,
}
);
}
#[test]
fn weight_to_fee_constants() {
assert_eq!(P_FACTOR, 10);
@@ -199,7 +223,7 @@ mod runtime_tests {
mod xcm_tests {
use frame_support::weights::Weight;
use parachain_template_runtime::xcm_config::*;
use parachain_template_runtime::configs::xcm_config::*;
#[test]
fn xcm_executor_constants() {