Skip to content

Commit

Permalink
Add header and format
Browse files Browse the repository at this point in the history
  • Loading branch information
Vicente Rocha authored and vicenterocha committed Feb 8, 2024
1 parent e11f4c0 commit 137f983
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 8 deletions.
19 changes: 19 additions & 0 deletions substrate/frame/staking/src/tests/election_data_provider.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
// This file is part of Substrate.

// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//! Tests for the election data provider.
use super::*;
use frame_election_provider_support::ElectionDataProvider;

Expand Down
19 changes: 19 additions & 0 deletions substrate/frame/staking/src/tests/ledger.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
// This file is part of Substrate.

// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//! Tests for the ledger.
use super::*;

#[test]
Expand Down
16 changes: 8 additions & 8 deletions substrate/frame/staking/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,9 +375,9 @@ fn rewards_should_work() {
);
assert_eq_error_rate!(
Balances::total_balance(&101),
init_balance_101
+ part_for_101_from_11 * total_payout_0 * 2 / 3
+ part_for_101_from_21 * total_payout_0 * 1 / 3,
init_balance_101 +
part_for_101_from_11 * total_payout_0 * 2 / 3 +
part_for_101_from_21 * total_payout_0 * 1 / 3,
2
);

Expand Down Expand Up @@ -414,9 +414,9 @@ fn rewards_should_work() {
);
assert_eq_error_rate!(
Balances::total_balance(&101),
init_balance_101
+ part_for_101_from_11 * (total_payout_0 * 2 / 3 + total_payout_1)
+ part_for_101_from_21 * total_payout_0 * 1 / 3,
init_balance_101 +
part_for_101_from_11 * (total_payout_0 * 2 / 3 + total_payout_1) +
part_for_101_from_21 * total_payout_0 * 1 / 3,
2
);
});
Expand Down Expand Up @@ -6087,8 +6087,8 @@ fn test_validator_exposure_is_backward_compatible_with_non_paged_rewards_payout(
let actual_exposure_page_1 = ErasStakersPaged::<Test>::get((1, 11, 1)).unwrap();
expected_individual_exposures.iter().for_each(|exposure| {
assert!(
actual_exposure_page_0.others.contains(exposure)
|| actual_exposure_page_1.others.contains(exposure)
actual_exposure_page_0.others.contains(exposure) ||
actual_exposure_page_1.others.contains(exposure)
);
});
assert_eq!(
Expand Down
19 changes: 19 additions & 0 deletions substrate/frame/staking/src/tests/sorted_list_provider.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
// This file is part of Substrate.

// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//! Tests for the sorted list provider.
use super::*;
use frame_election_provider_support::SortedListProvider;

Expand Down
19 changes: 19 additions & 0 deletions substrate/frame/staking/src/tests/staking_interface.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
// This file is part of Substrate.

// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//! Tests for the staking interface.
use frame_support::storage::with_storage_layer;
use sp_staking::StakingInterface;

Expand Down

0 comments on commit 137f983

Please sign in to comment.