diff --git a/runtime/pangolin/tests/tests.rs b/runtime/pangolin/tests/tests.rs index 18fa01a2f..255e44c35 100644 --- a/runtime/pangolin/tests/tests.rs +++ b/runtime/pangolin/tests/tests.rs @@ -68,6 +68,138 @@ mod balances { } } +mod assets { + // darwinia + use super::mock::*; + use frame_support::traits::{AsEnsureOriginWithArg, Get, IsInVec}; + use static_assertions::assert_type_eq_all; + + #[test] + fn ensure_constants_and_origin_correctly() { + assert_type_eq_all!(::ForceOrigin, Root); + assert_type_eq_all!( + ::CreateOrigin, + AsEnsureOriginWithArg, AccountId>> + ); + + assert_eq!( + <::AssetAccountDeposit as Get>::get(), + 0 + ); + assert_eq!( + <::MetadataDepositPerByte as Get>::get(), + 0 + ); + assert_eq!( + <::MetadataDepositBase as Get>::get(), + 0 + ); + assert_eq!(<::AssetDeposit as Get>::get(), 0); + assert_eq!(<::RemoveItemsLimit as Get>::get(), 1000); + assert_eq!(<::StringLimit as Get>::get(), 50); + } +} + +mod governance { + // darwinia + use super::mock::*; + use frame_support::traits::{AsEnsureOriginWithArg, Get, IsInVec}; + use static_assertions::assert_type_eq_all; + + #[test] + fn preimages_setting_correctly() { + assert_eq!( + <::BaseDeposit as Get>::get(), + 500 * UNIT + ); + assert_eq!( + <::ByteDeposit as Get>::get(), + darwinia_deposit(0, 1) + ); + assert_type_eq_all!(::ManagerOrigin, Root); + } + + #[test] + fn scheduler_setting_correctly() { + assert_eq!( + <::MaxScheduledPerBlock as Get>::get(), + 50 + ); + assert_type_eq_all!(::ScheduleOrigin, Root); + } + + #[test] + fn democracy_setting_correctly() { + assert_type_eq_all!(::BlacklistOrigin, Root); + assert_type_eq_all!( + ::CancelProposalOrigin, + RootOrAll + ); + assert_type_eq_all!( + ::CancellationOrigin, + RootOrAtLeastTwoThird + ); + assert_type_eq_all!( + ::ExternalDefaultOrigin, + RootOrAll + ); + assert_type_eq_all!( + ::ExternalMajorityOrigin, + RootOrAtLeastHalf + ); + assert_type_eq_all!( + ::ExternalOrigin, + RootOrAtLeastHalf + ); + assert_type_eq_all!( + ::FastTrackOrigin, + RootOrAtLeastTwoThird + ); + assert_type_eq_all!( + ::InstantOrigin, + RootOrAll + ); + assert_type_eq_all!(::VetoOrigin, pallet_collective::EnsureMember); + + assert_eq!( + <::CooloffPeriod as Get>::get(), + 5 * MINUTES + ); + assert_eq!( + <::EnactmentPeriod as Get>::get(), + 10 * MINUTES + ); + assert_eq!( + <::FastTrackVotingPeriod as Get>::get(), + MINUTES + ); + assert_eq!( + <::InstantAllowed as Get>::get(), + true + ); + assert_eq!( + <::LaunchPeriod as Get>::get(), + 10 * MINUTES + ); + assert_eq!(<::MaxBlacklisted as Get>::get(), 100); + assert_eq!(<::MaxDeposits as Get>::get(), 100); + assert_eq!(<::MaxProposals as Get>::get(), 100); + assert_eq!(<::MaxVotes as Get>::get(), 100); + assert_eq!( + <::MinimumDeposit as Get>::get(), + DARWINIA_PROPOSAL_REQUIREMENT + ); + assert_eq!( + <::VoteLockingPeriod as Get>::get(), + 10 * MINUTES + ); + assert_eq!( + <::VotingPeriod as Get>::get(), + 10 * MINUTES + ); + } +} + mod evm { // darwinia use super::mock::*;