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
+12 -12
View File
@@ -289,7 +289,7 @@ fn can_enact_next_config() {
assert_eq!(NextEpochConfig::<Test>::get(), Some(next_config.clone()));
Babe::plan_config_change(
Origin::root(),
RuntimeOrigin::root(),
NextConfigDescriptor::V1 {
c: next_next_config.c,
allowed_slots: next_next_config.allowed_slots,
@@ -323,15 +323,15 @@ fn only_root_can_enact_config_change() {
let next_config =
NextConfigDescriptor::V1 { c: (1, 4), allowed_slots: AllowedSlots::PrimarySlots };
let res = Babe::plan_config_change(Origin::none(), next_config.clone());
let res = Babe::plan_config_change(RuntimeOrigin::none(), next_config.clone());
assert_noop!(res, DispatchError::BadOrigin);
let res = Babe::plan_config_change(Origin::signed(1), next_config.clone());
let res = Babe::plan_config_change(RuntimeOrigin::signed(1), next_config.clone());
assert_noop!(res, DispatchError::BadOrigin);
let res = Babe::plan_config_change(Origin::root(), next_config);
let res = Babe::plan_config_change(RuntimeOrigin::root(), next_config);
assert!(res.is_ok());
});
@@ -464,7 +464,7 @@ fn report_equivocation_current_session_works() {
// report the equivocation
Babe::report_equivocation_unsigned(
Origin::none(),
RuntimeOrigin::none(),
Box::new(equivocation_proof),
key_owner_proof,
)
@@ -536,7 +536,7 @@ fn report_equivocation_old_session_works() {
// report the equivocation
Babe::report_equivocation_unsigned(
Origin::none(),
RuntimeOrigin::none(),
Box::new(equivocation_proof),
key_owner_proof,
)
@@ -588,7 +588,7 @@ fn report_equivocation_invalid_key_owner_proof() {
key_owner_proof.session = 0;
assert_err!(
Babe::report_equivocation_unsigned(
Origin::none(),
RuntimeOrigin::none(),
Box::new(equivocation_proof.clone()),
key_owner_proof
),
@@ -608,7 +608,7 @@ fn report_equivocation_invalid_key_owner_proof() {
assert_err!(
Babe::report_equivocation_unsigned(
Origin::none(),
RuntimeOrigin::none(),
Box::new(equivocation_proof),
key_owner_proof,
),
@@ -642,7 +642,7 @@ fn report_equivocation_invalid_equivocation_proof() {
let assert_invalid_equivocation = |equivocation_proof| {
assert_err!(
Babe::report_equivocation_unsigned(
Origin::none(),
RuntimeOrigin::none(),
Box::new(equivocation_proof),
key_owner_proof.clone(),
),
@@ -784,7 +784,7 @@ fn report_equivocation_validate_unsigned_prevents_duplicates() {
// we submit the report
Babe::report_equivocation_unsigned(
Origin::none(),
RuntimeOrigin::none(),
Box::new(equivocation_proof),
key_owner_proof,
)
@@ -857,7 +857,7 @@ fn valid_equivocation_reports_dont_pay_fees() {
// report the equivocation.
let post_info = Babe::report_equivocation_unsigned(
Origin::none(),
RuntimeOrigin::none(),
Box::new(equivocation_proof.clone()),
key_owner_proof.clone(),
)
@@ -871,7 +871,7 @@ fn valid_equivocation_reports_dont_pay_fees() {
// report the equivocation again which is invalid now since it is
// duplicate.
let post_info = Babe::report_equivocation_unsigned(
Origin::none(),
RuntimeOrigin::none(),
Box::new(equivocation_proof),
key_owner_proof,
)