mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 19:21:13 +00:00
Use pallet names to name enum variants (#8990)
* Remove unused event_metadata variable * Eliminate mod_name and use pallet names to name enum variants * Rename field name `pallet` to `path` * Use only the pallet name to generate variant names * Use new naming scheme for Event enum in sudo pallet tests * Use new naming scheme for Event enum in offences pallet tests * Use new naming scheme for Event enum in contracts pallet tests * Use new naming scheme for Event enum in collective pallet tests * Use new naming scheme for Event enum in bounties pallet tests * Use new naming scheme for Event enum in balances pallet tests * Use new naming scheme for Event enum in assets pallet tests * Use new naming scheme for Event enum in frame support tests * Use new naming scheme for Event enum in tips pallet tests * Use new naming scheme for Event enum in transaction payment pallet tests * Use new naming scheme for GenesisConfig fields in example pallet tests * Use new naming scheme for GenesisConfig fields in elections pallet tests * Use new naming scheme for Event enum in election provider multi-phase pallet tests * Use new naming scheme for Event enum in elections phragmen pallet tests * Use new naming scheme for GenesisConfig fields in chain spec * Use new naming scheme for Event enum in staking pallet mock * Use new naming scheme for GenesisConfig fields in node-template chain spec * Use new naming scheme for GenesisConfig fields in node-testing chain spec * Use new naming scheme for Event enum in node executor tests * Use new naming scheme for GenesisConfig fields in transaction storage pallet mock * Refactor match conditions
This commit is contained in:
@@ -1059,15 +1059,15 @@ mod tests {
|
||||
|
||||
pub fn new_test_ext() -> sp_io::TestExternalities {
|
||||
let mut ext: sp_io::TestExternalities = GenesisConfig {
|
||||
collective_Instance1: collective::GenesisConfig {
|
||||
collective: collective::GenesisConfig {
|
||||
members: vec![1, 2, 3],
|
||||
phantom: Default::default(),
|
||||
},
|
||||
collective_Instance2: collective::GenesisConfig {
|
||||
collective_majority: collective::GenesisConfig {
|
||||
members: vec![1, 2, 3, 4, 5],
|
||||
phantom: Default::default(),
|
||||
},
|
||||
collective: Default::default(),
|
||||
default_collective: Default::default(),
|
||||
}.build_storage().unwrap().into();
|
||||
ext.execute_with(|| System::set_block_number(1));
|
||||
ext
|
||||
@@ -1107,10 +1107,10 @@ mod tests {
|
||||
|
||||
let record = |event| EventRecord { phase: Phase::Initialization, event, topics: vec![] };
|
||||
assert_eq!(System::events(), vec![
|
||||
record(Event::collective_Instance1(RawEvent::Proposed(1, 0, hash.clone(), 3))),
|
||||
record(Event::collective_Instance1(RawEvent::Voted(2, hash.clone(), true, 2, 0))),
|
||||
record(Event::collective_Instance1(RawEvent::Closed(hash.clone(), 2, 1))),
|
||||
record(Event::collective_Instance1(RawEvent::Disapproved(hash.clone())))
|
||||
record(Event::Collective(RawEvent::Proposed(1, 0, hash.clone(), 3))),
|
||||
record(Event::Collective(RawEvent::Voted(2, hash.clone(), true, 2, 0))),
|
||||
record(Event::Collective(RawEvent::Closed(hash.clone(), 2, 1))),
|
||||
record(Event::Collective(RawEvent::Disapproved(hash.clone())))
|
||||
]);
|
||||
});
|
||||
}
|
||||
@@ -1169,10 +1169,10 @@ mod tests {
|
||||
|
||||
let record = |event| EventRecord { phase: Phase::Initialization, event, topics: vec![] };
|
||||
assert_eq!(System::events(), vec![
|
||||
record(Event::collective_Instance1(RawEvent::Proposed(1, 0, hash.clone(), 3))),
|
||||
record(Event::collective_Instance1(RawEvent::Voted(2, hash.clone(), true, 2, 0))),
|
||||
record(Event::collective_Instance1(RawEvent::Closed(hash.clone(), 2, 1))),
|
||||
record(Event::collective_Instance1(RawEvent::Disapproved(hash.clone())))
|
||||
record(Event::Collective(RawEvent::Proposed(1, 0, hash.clone(), 3))),
|
||||
record(Event::Collective(RawEvent::Voted(2, hash.clone(), true, 2, 0))),
|
||||
record(Event::Collective(RawEvent::Closed(hash.clone(), 2, 1))),
|
||||
record(Event::Collective(RawEvent::Disapproved(hash.clone())))
|
||||
]);
|
||||
});
|
||||
}
|
||||
@@ -1194,11 +1194,11 @@ mod tests {
|
||||
|
||||
let record = |event| EventRecord { phase: Phase::Initialization, event, topics: vec![] };
|
||||
assert_eq!(System::events(), vec![
|
||||
record(Event::collective_Instance1(RawEvent::Proposed(1, 0, hash.clone(), 3))),
|
||||
record(Event::collective_Instance1(RawEvent::Voted(2, hash.clone(), true, 2, 0))),
|
||||
record(Event::collective_Instance1(RawEvent::Closed(hash.clone(), 3, 0))),
|
||||
record(Event::collective_Instance1(RawEvent::Approved(hash.clone()))),
|
||||
record(Event::collective_Instance1(RawEvent::Executed(hash.clone(), Err(DispatchError::BadOrigin))))
|
||||
record(Event::Collective(RawEvent::Proposed(1, 0, hash.clone(), 3))),
|
||||
record(Event::Collective(RawEvent::Voted(2, hash.clone(), true, 2, 0))),
|
||||
record(Event::Collective(RawEvent::Closed(hash.clone(), 3, 0))),
|
||||
record(Event::Collective(RawEvent::Approved(hash.clone()))),
|
||||
record(Event::Collective(RawEvent::Executed(hash.clone(), Err(DispatchError::BadOrigin))))
|
||||
]);
|
||||
});
|
||||
}
|
||||
@@ -1221,12 +1221,12 @@ mod tests {
|
||||
|
||||
let record = |event| EventRecord { phase: Phase::Initialization, event, topics: vec![] };
|
||||
assert_eq!(System::events(), vec![
|
||||
record(Event::collective_Instance2(RawEvent::Proposed(1, 0, hash.clone(), 5))),
|
||||
record(Event::collective_Instance2(RawEvent::Voted(2, hash.clone(), true, 2, 0))),
|
||||
record(Event::collective_Instance2(RawEvent::Voted(3, hash.clone(), true, 3, 0))),
|
||||
record(Event::collective_Instance2(RawEvent::Closed(hash.clone(), 5, 0))),
|
||||
record(Event::collective_Instance2(RawEvent::Approved(hash.clone()))),
|
||||
record(Event::collective_Instance2(RawEvent::Executed(hash.clone(), Err(DispatchError::BadOrigin))))
|
||||
record(Event::CollectiveMajority(RawEvent::Proposed(1, 0, hash.clone(), 5))),
|
||||
record(Event::CollectiveMajority(RawEvent::Voted(2, hash.clone(), true, 2, 0))),
|
||||
record(Event::CollectiveMajority(RawEvent::Voted(3, hash.clone(), true, 3, 0))),
|
||||
record(Event::CollectiveMajority(RawEvent::Closed(hash.clone(), 5, 0))),
|
||||
record(Event::CollectiveMajority(RawEvent::Approved(hash.clone()))),
|
||||
record(Event::CollectiveMajority(RawEvent::Executed(hash.clone(), Err(DispatchError::BadOrigin))))
|
||||
]);
|
||||
});
|
||||
}
|
||||
@@ -1321,7 +1321,7 @@ mod tests {
|
||||
assert_eq!(System::events(), vec![
|
||||
EventRecord {
|
||||
phase: Phase::Initialization,
|
||||
event: Event::collective_Instance1(RawEvent::Proposed(
|
||||
event: Event::Collective(RawEvent::Proposed(
|
||||
1,
|
||||
0,
|
||||
hex!["68eea8f20b542ec656c6ac2d10435ae3bd1729efc34d1354ab85af840aad2d35"].into(),
|
||||
@@ -1449,7 +1449,7 @@ mod tests {
|
||||
assert_eq!(System::events(), vec![
|
||||
EventRecord {
|
||||
phase: Phase::Initialization,
|
||||
event: Event::collective_Instance1(RawEvent::Proposed(
|
||||
event: Event::Collective(RawEvent::Proposed(
|
||||
1,
|
||||
0,
|
||||
hex!["68eea8f20b542ec656c6ac2d10435ae3bd1729efc34d1354ab85af840aad2d35"].into(),
|
||||
@@ -1459,7 +1459,7 @@ mod tests {
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::Initialization,
|
||||
event: Event::collective_Instance1(RawEvent::Voted(
|
||||
event: Event::Collective(RawEvent::Voted(
|
||||
1,
|
||||
hex!["68eea8f20b542ec656c6ac2d10435ae3bd1729efc34d1354ab85af840aad2d35"].into(),
|
||||
false,
|
||||
@@ -1592,7 +1592,7 @@ mod tests {
|
||||
assert_eq!(System::events(), vec![
|
||||
EventRecord {
|
||||
phase: Phase::Initialization,
|
||||
event: Event::collective_Instance1(
|
||||
event: Event::Collective(
|
||||
RawEvent::Proposed(
|
||||
1,
|
||||
0,
|
||||
@@ -1603,7 +1603,7 @@ mod tests {
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::Initialization,
|
||||
event: Event::collective_Instance1(RawEvent::Voted(
|
||||
event: Event::Collective(RawEvent::Voted(
|
||||
2,
|
||||
hex!["68eea8f20b542ec656c6ac2d10435ae3bd1729efc34d1354ab85af840aad2d35"].into(),
|
||||
false,
|
||||
@@ -1614,14 +1614,14 @@ mod tests {
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::Initialization,
|
||||
event: Event::collective_Instance1(RawEvent::Closed(
|
||||
event: Event::Collective(RawEvent::Closed(
|
||||
hex!["68eea8f20b542ec656c6ac2d10435ae3bd1729efc34d1354ab85af840aad2d35"].into(), 1, 1,
|
||||
)),
|
||||
topics: vec![],
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::Initialization,
|
||||
event: Event::collective_Instance1(RawEvent::Disapproved(
|
||||
event: Event::Collective(RawEvent::Disapproved(
|
||||
hex!["68eea8f20b542ec656c6ac2d10435ae3bd1729efc34d1354ab85af840aad2d35"].into(),
|
||||
)),
|
||||
topics: vec![],
|
||||
@@ -1644,7 +1644,7 @@ mod tests {
|
||||
assert_eq!(System::events(), vec![
|
||||
EventRecord {
|
||||
phase: Phase::Initialization,
|
||||
event: Event::collective_Instance1(RawEvent::Proposed(
|
||||
event: Event::Collective(RawEvent::Proposed(
|
||||
1,
|
||||
0,
|
||||
hex!["68eea8f20b542ec656c6ac2d10435ae3bd1729efc34d1354ab85af840aad2d35"].into(),
|
||||
@@ -1654,7 +1654,7 @@ mod tests {
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::Initialization,
|
||||
event: Event::collective_Instance1(RawEvent::Voted(
|
||||
event: Event::Collective(RawEvent::Voted(
|
||||
2,
|
||||
hex!["68eea8f20b542ec656c6ac2d10435ae3bd1729efc34d1354ab85af840aad2d35"].into(),
|
||||
true,
|
||||
@@ -1665,21 +1665,21 @@ mod tests {
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::Initialization,
|
||||
event: Event::collective_Instance1(RawEvent::Closed(
|
||||
event: Event::Collective(RawEvent::Closed(
|
||||
hex!["68eea8f20b542ec656c6ac2d10435ae3bd1729efc34d1354ab85af840aad2d35"].into(), 2, 0,
|
||||
)),
|
||||
topics: vec![],
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::Initialization,
|
||||
event: Event::collective_Instance1(RawEvent::Approved(
|
||||
event: Event::Collective(RawEvent::Approved(
|
||||
hex!["68eea8f20b542ec656c6ac2d10435ae3bd1729efc34d1354ab85af840aad2d35"].into(),
|
||||
)),
|
||||
topics: vec![],
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::Initialization,
|
||||
event: Event::collective_Instance1(RawEvent::Executed(
|
||||
event: Event::Collective(RawEvent::Executed(
|
||||
hex!["68eea8f20b542ec656c6ac2d10435ae3bd1729efc34d1354ab85af840aad2d35"].into(),
|
||||
Err(DispatchError::BadOrigin),
|
||||
)),
|
||||
@@ -1731,9 +1731,9 @@ mod tests {
|
||||
assert_ok!(Collective::disapprove_proposal(Origin::root(), hash.clone()));
|
||||
let record = |event| EventRecord { phase: Phase::Initialization, event, topics: vec![] };
|
||||
assert_eq!(System::events(), vec![
|
||||
record(Event::collective_Instance1(RawEvent::Proposed(1, 0, hash.clone(), 2))),
|
||||
record(Event::collective_Instance1(RawEvent::Voted(2, hash.clone(), true, 2, 0))),
|
||||
record(Event::collective_Instance1(RawEvent::Disapproved(hash.clone()))),
|
||||
record(Event::Collective(RawEvent::Proposed(1, 0, hash.clone(), 2))),
|
||||
record(Event::Collective(RawEvent::Voted(2, hash.clone(), true, 2, 0))),
|
||||
record(Event::Collective(RawEvent::Disapproved(hash.clone()))),
|
||||
]);
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user