mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-26 01:51:07 +00:00
Thread-local parameter_types for testing. (#7542)
* Thread-local parameter_types for testing. * Better docs. * Some minors * Merge'em * Update frame/support/src/lib.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Align more to basti's trick * Update frame/support/src/lib.rs * Update frame/support/src/lib.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
@@ -298,7 +298,7 @@ fn voting_initial_set_approvals_ignores_voter_index() {
|
||||
}
|
||||
#[test]
|
||||
fn voting_bad_approval_index_slashes_voters_and_bond_reduces_stake() {
|
||||
ExtBuilder::default().voting_fee(5).voter_bond(2).build().execute_with(|| {
|
||||
ExtBuilder::default().voting_fee(5).voting_bond(2).build().execute_with(|| {
|
||||
assert_ok!(Elections::submit_candidacy(Origin::signed(2), 0));
|
||||
|
||||
(1..=63).for_each(|i| vote(i, 0));
|
||||
@@ -365,7 +365,7 @@ fn voting_cannot_lock_less_than_limit() {
|
||||
|
||||
#[test]
|
||||
fn voting_locking_more_than_total_balance_is_moot() {
|
||||
ExtBuilder::default().voter_bond(2).build().execute_with(|| {
|
||||
ExtBuilder::default().voting_bond(2).build().execute_with(|| {
|
||||
assert_ok!(Elections::submit_candidacy(Origin::signed(2), 0));
|
||||
|
||||
assert_eq!(balances(&3), (30, 0));
|
||||
@@ -381,7 +381,7 @@ fn voting_locking_more_than_total_balance_is_moot() {
|
||||
|
||||
#[test]
|
||||
fn voting_locking_stake_and_reserving_bond_works() {
|
||||
ExtBuilder::default().voter_bond(2).build().execute_with(|| {
|
||||
ExtBuilder::default().voting_bond(2).build().execute_with(|| {
|
||||
assert_ok!(Elections::submit_candidacy(Origin::signed(5), 0));
|
||||
|
||||
assert_eq!(balances(&2), (20, 0));
|
||||
@@ -558,7 +558,7 @@ fn retracting_inactive_voter_should_work() {
|
||||
|
||||
#[test]
|
||||
fn retracting_inactive_voter_with_other_candidates_in_slots_should_work() {
|
||||
ExtBuilder::default().voter_bond(2).build().execute_with(|| {
|
||||
ExtBuilder::default().voting_bond(2).build().execute_with(|| {
|
||||
System::set_block_number(4);
|
||||
assert_ok!(Elections::submit_candidacy(Origin::signed(2), 0));
|
||||
assert_ok!(Elections::set_approvals(Origin::signed(2), vec![true], 0, 0, 20));
|
||||
@@ -1107,7 +1107,7 @@ fn election_present_when_presenter_is_poor_should_not_work() {
|
||||
let test_present = |p| {
|
||||
ExtBuilder::default()
|
||||
.voting_fee(5)
|
||||
.voter_bond(2)
|
||||
.voting_bond(2)
|
||||
.bad_presentation_punishment(p)
|
||||
.build()
|
||||
.execute_with(|| {
|
||||
@@ -1507,7 +1507,7 @@ fn pot_winning_resets_accumulated_pot() {
|
||||
#[test]
|
||||
fn pot_resubmitting_approvals_stores_pot() {
|
||||
ExtBuilder::default()
|
||||
.voter_bond(0)
|
||||
.voting_bond(0)
|
||||
.voting_fee(0)
|
||||
.balance_factor(10)
|
||||
.build()
|
||||
|
||||
Reference in New Issue
Block a user