mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-25 13:01:09 +00:00
BREAKING: Rename Origin (#12258)
* BREAKING: Rename Origin * more renaming * a bit more renaming * fix * more fixing * fix in frame_support * even more fixes * fix * small fix * ... * update .stderr * docs * update docs * update docs * docs
This commit is contained in:
@@ -24,7 +24,7 @@ fn overvoting_should_fail() {
|
||||
new_test_ext().execute_with(|| {
|
||||
let r = begin_referendum();
|
||||
assert_noop!(
|
||||
Democracy::vote(Origin::signed(1), r, aye(2)),
|
||||
Democracy::vote(RuntimeOrigin::signed(1), r, aye(2)),
|
||||
Error::<Test>::InsufficientFunds
|
||||
);
|
||||
});
|
||||
@@ -35,9 +35,12 @@ fn split_voting_should_work() {
|
||||
new_test_ext().execute_with(|| {
|
||||
let r = begin_referendum();
|
||||
let v = AccountVote::Split { aye: 40, nay: 20 };
|
||||
assert_noop!(Democracy::vote(Origin::signed(5), r, v), Error::<Test>::InsufficientFunds);
|
||||
assert_noop!(
|
||||
Democracy::vote(RuntimeOrigin::signed(5), r, v),
|
||||
Error::<Test>::InsufficientFunds
|
||||
);
|
||||
let v = AccountVote::Split { aye: 30, nay: 20 };
|
||||
assert_ok!(Democracy::vote(Origin::signed(5), r, v));
|
||||
assert_ok!(Democracy::vote(RuntimeOrigin::signed(5), r, v));
|
||||
|
||||
assert_eq!(tally(r), Tally { ayes: 3, nays: 2, turnout: 50 });
|
||||
});
|
||||
@@ -48,10 +51,10 @@ fn split_vote_cancellation_should_work() {
|
||||
new_test_ext().execute_with(|| {
|
||||
let r = begin_referendum();
|
||||
let v = AccountVote::Split { aye: 30, nay: 20 };
|
||||
assert_ok!(Democracy::vote(Origin::signed(5), r, v));
|
||||
assert_ok!(Democracy::remove_vote(Origin::signed(5), r));
|
||||
assert_ok!(Democracy::vote(RuntimeOrigin::signed(5), r, v));
|
||||
assert_ok!(Democracy::remove_vote(RuntimeOrigin::signed(5), r));
|
||||
assert_eq!(tally(r), Tally { ayes: 0, nays: 0, turnout: 0 });
|
||||
assert_ok!(Democracy::unlock(Origin::signed(5), 5));
|
||||
assert_ok!(Democracy::unlock(RuntimeOrigin::signed(5), 5));
|
||||
assert_eq!(Balances::locks(5), vec![]);
|
||||
});
|
||||
}
|
||||
@@ -66,7 +69,7 @@ fn single_proposal_should_work() {
|
||||
|
||||
// start of 2 => next referendum scheduled.
|
||||
fast_forward_to(2);
|
||||
assert_ok!(Democracy::vote(Origin::signed(1), r, aye(1)));
|
||||
assert_ok!(Democracy::vote(RuntimeOrigin::signed(1), r, aye(1)));
|
||||
|
||||
assert_eq!(Democracy::referendum_count(), 1);
|
||||
assert_eq!(
|
||||
@@ -108,12 +111,12 @@ fn controversial_voting_should_work() {
|
||||
0,
|
||||
);
|
||||
|
||||
assert_ok!(Democracy::vote(Origin::signed(1), r, big_aye(1)));
|
||||
assert_ok!(Democracy::vote(Origin::signed(2), r, big_nay(2)));
|
||||
assert_ok!(Democracy::vote(Origin::signed(3), r, big_nay(3)));
|
||||
assert_ok!(Democracy::vote(Origin::signed(4), r, big_aye(4)));
|
||||
assert_ok!(Democracy::vote(Origin::signed(5), r, big_nay(5)));
|
||||
assert_ok!(Democracy::vote(Origin::signed(6), r, big_aye(6)));
|
||||
assert_ok!(Democracy::vote(RuntimeOrigin::signed(1), r, big_aye(1)));
|
||||
assert_ok!(Democracy::vote(RuntimeOrigin::signed(2), r, big_nay(2)));
|
||||
assert_ok!(Democracy::vote(RuntimeOrigin::signed(3), r, big_nay(3)));
|
||||
assert_ok!(Democracy::vote(RuntimeOrigin::signed(4), r, big_aye(4)));
|
||||
assert_ok!(Democracy::vote(RuntimeOrigin::signed(5), r, big_nay(5)));
|
||||
assert_ok!(Democracy::vote(RuntimeOrigin::signed(6), r, big_aye(6)));
|
||||
|
||||
assert_eq!(tally(r), Tally { ayes: 110, nays: 100, turnout: 210 });
|
||||
|
||||
@@ -133,8 +136,8 @@ fn controversial_low_turnout_voting_should_work() {
|
||||
VoteThreshold::SuperMajorityApprove,
|
||||
0,
|
||||
);
|
||||
assert_ok!(Democracy::vote(Origin::signed(5), r, big_nay(5)));
|
||||
assert_ok!(Democracy::vote(Origin::signed(6), r, big_aye(6)));
|
||||
assert_ok!(Democracy::vote(RuntimeOrigin::signed(5), r, big_nay(5)));
|
||||
assert_ok!(Democracy::vote(RuntimeOrigin::signed(6), r, big_aye(6)));
|
||||
|
||||
assert_eq!(tally(r), Tally { ayes: 60, nays: 50, turnout: 110 });
|
||||
|
||||
@@ -157,9 +160,9 @@ fn passing_low_turnout_voting_should_work() {
|
||||
VoteThreshold::SuperMajorityApprove,
|
||||
0,
|
||||
);
|
||||
assert_ok!(Democracy::vote(Origin::signed(4), r, big_aye(4)));
|
||||
assert_ok!(Democracy::vote(Origin::signed(5), r, big_nay(5)));
|
||||
assert_ok!(Democracy::vote(Origin::signed(6), r, big_aye(6)));
|
||||
assert_ok!(Democracy::vote(RuntimeOrigin::signed(4), r, big_aye(4)));
|
||||
assert_ok!(Democracy::vote(RuntimeOrigin::signed(5), r, big_nay(5)));
|
||||
assert_ok!(Democracy::vote(RuntimeOrigin::signed(6), r, big_aye(6)));
|
||||
assert_eq!(tally(r), Tally { ayes: 100, nays: 50, turnout: 150 });
|
||||
|
||||
next_block();
|
||||
|
||||
Reference in New Issue
Block a user