Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions node/service/src/chain_spec/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ fn karura_foundation_accounts_config_is_correct() {
}

#[test]
#[cfg(feature = "with-acala-runtime")]
fn check_acala_vesting() {
let vesting_json = &include_bytes!("../../../../resources/acala-vesting-ACA.json")[..];
let vesting: Vec<(AccountId, BlockNumber, BlockNumber, u32, Balance)> =
Expand All @@ -50,13 +51,29 @@ fn check_acala_vesting() {
}

#[test]
#[cfg(feature = "with-acala-runtime")]
fn check_acala_allocation() {
let allocation_json = &include_bytes!("../../../../resources/acala-allocation-ACA.json")[..];
let _: Vec<(AccountId, Balance)> = serde_json::from_slice(allocation_json).unwrap();
let allocation: Vec<(AccountId, Balance)> = serde_json::from_slice(allocation_json).unwrap();
let mut total: Balance = Default::default();

// ensure no duplicates exist.
let unique_allocation_accounts = allocation
.iter()
.map(|(account_id, amount)| {
total = total.saturating_add(*amount);
account_id
})
.cloned()
.collect::<std::collections::BTreeSet<_>>();
assert_eq!(unique_allocation_accounts.len(), allocation.len());

// ensure total allocation.
assert_eq!(total, 1_000_000_000_000_000_000_000);
}

#[test]
fn check_acala_airdrop() {
fn check_mandala_airdrop() {
let airdrop_json = &include_bytes!("../../../../resources/mandala-airdrop-ACA.json")[..];
let _: Vec<(AccountId, Balance)> = serde_json::from_slice(airdrop_json).unwrap();
}
Expand Down
Loading