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:
Sergej Sakac
2022-09-21 00:13:09 +02:00
committed by GitHub
parent 986d20b352
commit e4b6f4a66d
221 changed files with 5233 additions and 4200 deletions
+15 -6
View File
@@ -131,7 +131,7 @@ impl frame_system::Config for Test {
type BlockWeights = ();
type BlockLength = ();
type DbWeight = RocksDbWeight;
type Origin = Origin;
type RuntimeOrigin = RuntimeOrigin;
type Index = AccountIndex;
type BlockNumber = BlockNumber;
type RuntimeCall = RuntimeCall;
@@ -660,13 +660,22 @@ pub(crate) fn current_era() -> EraIndex {
pub(crate) fn bond(stash: AccountId, ctrl: AccountId, val: Balance) {
let _ = Balances::make_free_balance_be(&stash, val);
let _ = Balances::make_free_balance_be(&ctrl, val);
assert_ok!(Staking::bond(Origin::signed(stash), ctrl, val, RewardDestination::Controller));
assert_ok!(Staking::bond(
RuntimeOrigin::signed(stash),
ctrl,
val,
RewardDestination::Controller
));
}
pub(crate) fn bond_validator(stash: AccountId, ctrl: AccountId, val: Balance) {
bond(stash, ctrl, val);
assert_ok!(Staking::validate(Origin::signed(ctrl), ValidatorPrefs::default()));
assert_ok!(Session::set_keys(Origin::signed(ctrl), SessionKeys { other: ctrl.into() }, vec![]));
assert_ok!(Staking::validate(RuntimeOrigin::signed(ctrl), ValidatorPrefs::default()));
assert_ok!(Session::set_keys(
RuntimeOrigin::signed(ctrl),
SessionKeys { other: ctrl.into() },
vec![]
));
}
pub(crate) fn bond_nominator(
@@ -676,7 +685,7 @@ pub(crate) fn bond_nominator(
target: Vec<AccountId>,
) {
bond(stash, ctrl, val);
assert_ok!(Staking::nominate(Origin::signed(ctrl), target));
assert_ok!(Staking::nominate(RuntimeOrigin::signed(ctrl), target));
}
/// Progress to the given block, triggering session and era changes as we progress.
@@ -846,7 +855,7 @@ pub(crate) fn make_all_reward_payment(era: EraIndex) {
// reward validators
for validator_controller in validators_with_reward.iter().filter_map(Staking::bonded) {
let ledger = <Ledger<Test>>::get(&validator_controller).unwrap();
assert_ok!(Staking::payout_stakers(Origin::signed(1337), ledger.stash, era));
assert_ok!(Staking::payout_stakers(RuntimeOrigin::signed(1337), ledger.stash, era));
}
}