1
// Copyright (C) Parity Technologies (UK) Ltd.
2
// This file is part of Polkadot.
3

            
4
// Polkadot is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
8

            
9
// Polkadot is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
// GNU General Public License for more details.
13

            
14
// You should have received a copy of the GNU General Public License
15
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
16

            
17
//! Tests for the Dancelight Runtime Configuration
18

            
19
use {crate::*, std::collections::HashSet};
20

            
21
use {frame_support::traits::WhitelistedStorageKeys, sp_core::hexdisplay::HexDisplay};
22

            
23
mod author_noting_tests;
24
mod beefy;
25
mod collator_assignment_tests;
26
mod common;
27
mod core_scheduling_tests;
28
mod ethereum_client;
29
mod external_validators_tests;
30
mod inflation_rewards;
31
mod integration_test;
32
mod migrations_test;
33
mod relay_configuration;
34
mod relay_registrar;
35
mod services_payment;
36
mod session_keys;
37
mod slashes;
38
mod sudo;
39

            
40
#[test]
41
1
fn check_whitelist() {
42
1
    let whitelist: HashSet<String> = AllPalletsWithSystem::whitelisted_storage_keys()
43
1
        .iter()
44
10
        .map(|e| HexDisplay::from(&e.key).to_string())
45
1
        .collect();
46
1

            
47
1
    // Block number
48
1
    assert!(whitelist.contains("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac"));
49
    // Total issuance
50
1
    assert!(whitelist.contains("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80"));
51
    // Execution phase
52
1
    assert!(whitelist.contains("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a"));
53
    // Event count
54
1
    assert!(whitelist.contains("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850"));
55
    // System events
56
1
    assert!(whitelist.contains("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7"));
57
    // XcmPallet VersionDiscoveryQueue
58
1
    assert!(whitelist.contains("1405f2411d0af5a7ff397e7c9dc68d194a222ba0333561192e474c59ed8e30e1"));
59
    // XcmPallet SafeXcmVersion
60
1
    assert!(whitelist.contains("1405f2411d0af5a7ff397e7c9dc68d196323ae84c43568be0d1394d5d0d522c4"));
61
1
}
62

            
63
#[test]
64
1
fn check_treasury_pallet_id() {
65
1
    assert_eq!(
66
1
        <Treasury as frame_support::traits::PalletInfoAccess>::index() as u8,
67
1
        dancelight_runtime_constants::TREASURY_PALLET_ID
68
1
    );
69
1
}