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
@@ -700,7 +700,7 @@ pub mod pallet {
/// Origin that can control this pallet. Note that any action taken by this origin (such)
/// as providing an emergency solution is not checked. Thus, it must be a trusted origin.
type ForceOrigin: EnsureOrigin<Self::Origin>;
type ForceOrigin: EnsureOrigin<Self::RuntimeOrigin>;
/// The configuration of benchmarking.
type BenchmarkingConfig: BenchmarkingConfig;
@@ -1828,7 +1828,7 @@ mod tests {
use crate::{
mock::{
multi_phase_events, raw_solution, roll_to, AccountId, ExtBuilder, MockWeightInfo,
MockedWeightInfo, MultiPhase, Origin, Runtime, SignedMaxSubmissions, System,
MockedWeightInfo, MultiPhase, Runtime, RuntimeOrigin, SignedMaxSubmissions, System,
TargetIndex, Targets,
},
Phase,
@@ -2030,7 +2030,10 @@ mod tests {
score: ElectionScore { minimal_stake: (5 + s).into(), ..Default::default() },
..Default::default()
};
assert_ok!(MultiPhase::submit(crate::mock::Origin::signed(99), Box::new(solution)));
assert_ok!(MultiPhase::submit(
crate::mock::RuntimeOrigin::signed(99),
Box::new(solution)
));
}
// an unexpected call to elect.
@@ -2057,7 +2060,10 @@ mod tests {
assert!(MultiPhase::current_phase().is_signed());
let solution = raw_solution();
assert_ok!(MultiPhase::submit(crate::mock::Origin::signed(99), Box::new(solution)));
assert_ok!(MultiPhase::submit(
crate::mock::RuntimeOrigin::signed(99),
Box::new(solution)
));
roll_to(30);
assert_ok!(MultiPhase::elect());
@@ -2098,7 +2104,7 @@ mod tests {
// ensure this solution is valid.
assert!(MultiPhase::queued_solution().is_none());
assert_ok!(MultiPhase::submit_unsigned(
crate::mock::Origin::none(),
crate::mock::RuntimeOrigin::none(),
Box::new(solution),
witness
));
@@ -2176,12 +2182,12 @@ mod tests {
// no single account can trigger this
assert_noop!(
MultiPhase::governance_fallback(Origin::signed(99), None, None),
MultiPhase::governance_fallback(RuntimeOrigin::signed(99), None, None),
DispatchError::BadOrigin
);
// only root can
assert_ok!(MultiPhase::governance_fallback(Origin::root(), None, None));
assert_ok!(MultiPhase::governance_fallback(RuntimeOrigin::root(), None, None));
// something is queued now
assert!(MultiPhase::queued_solution().is_some());
// next election call with fix everything.;