Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 435409c

Browse files
committed
add test
1 parent 8c5642f commit 435409c

File tree

4 files changed

+4688
-1
lines changed

4 files changed

+4688
-1
lines changed

runtime/common/src/attestations.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ impl<T: staking::Trait> RewardAttestation for staking::Module<T> {
7979
// https://research.web3.foundation/en/latest/polkadot/Token%20Economics/#payment-details
8080
const STAKING_REWARD_POINTS: u32 = 20;
8181

82-
Self::reward_by_indices(validator_indices.into_iter().map(|i| (i, STAKING_REWARD_POINTS)))
82+
// NOTE: remove for this test branch
83+
// Self::reward_by_indices(validator_indices.into_iter().map(|i| (i, STAKING_REWARD_POINTS)))
8384
}
8485
}
8586

runtime/kusama/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.
2121
#![recursion_limit="256"]
2222

23+
#[cfg(test)]
24+
mod tests;
25+
2326
use rstd::prelude::*;
2427
use sp_core::u32_trait::{_1, _2, _3, _4, _5};
2528
use codec::{Encode, Decode};

runtime/kusama/src/tests/mod.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
mod test_upgrade_from_kusama_dataset;
2+
3+
// Test that an upgrade from previous test environment works.
4+
#[test]
5+
fn test_upgrade_staking_works() {
6+
let mut storage = sp_runtime::Storage::default();
7+
for (key, value) in test_upgrade_from_kusama_dataset::KUSAMA.iter() {
8+
storage.top.insert(key.to_vec(), value.to_vec());
9+
}
10+
let mut ext = sp_io::TestExternalities::from(storage);
11+
ext.execute_with(|| {
12+
super::Staking::test_do_upgrade();
13+
});
14+
}

0 commit comments

Comments
 (0)