mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 09:57:56 +00:00
Add pallet names to Events (#10296)
* chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: formatted pallet name changes in events * chore: formatted pallet name changes in events * chore: formatted pallet name changes in events * chore: formatted pallet name changes in events * chore: formatted pallet name changes in events * chore: formatted pallet name changes in events * chore: formatted pallet name changes in events * chore: formatted pallet name changes in events * chore: formatted pallet name changes in events * fix: add fix to tests for event variants * chore: modified comments for event variants * chore: modified comments for event variants * chore: modified comments for event variants * chore: modified comments for event variants * chore: modified system pallet event variants * chore: modified system pallet event variants * chore: modified system pallet event variants * chore: modified system pallet event variants * chore: modified system pallet event variants * chore: modified system pallet event variants * chore: modified system pallet event variants * chore: modified system pallet event variants * chore: modified system pallet event variants * chore: updated transaction-storage pallet event variants * chore: updated transaction-storage pallet event variants * chore: formatted contracts pallet * chore: update treasury event variants
This commit is contained in:
@@ -168,44 +168,44 @@ fn deposit_event_should_work() {
|
||||
);
|
||||
|
||||
System::initialize(&2, &[0u8; 32].into(), &Default::default(), InitKind::Full);
|
||||
System::deposit_event(SysEvent::NewAccount(32));
|
||||
System::deposit_event(SysEvent::NewAccount { account: 32 });
|
||||
System::note_finished_initialize();
|
||||
System::deposit_event(SysEvent::KilledAccount(42));
|
||||
System::deposit_event(SysEvent::KilledAccount { account: 42 });
|
||||
System::note_applied_extrinsic(&Ok(().into()), Default::default());
|
||||
System::note_applied_extrinsic(&Err(DispatchError::BadOrigin.into()), Default::default());
|
||||
System::note_finished_extrinsics();
|
||||
System::deposit_event(SysEvent::NewAccount(3));
|
||||
System::deposit_event(SysEvent::NewAccount { account: 3 });
|
||||
System::finalize();
|
||||
assert_eq!(
|
||||
System::events(),
|
||||
vec![
|
||||
EventRecord {
|
||||
phase: Phase::Initialization,
|
||||
event: SysEvent::NewAccount(32).into(),
|
||||
event: SysEvent::NewAccount { account: 32 }.into(),
|
||||
topics: vec![],
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(0),
|
||||
event: SysEvent::KilledAccount(42).into(),
|
||||
event: SysEvent::KilledAccount { account: 42 }.into(),
|
||||
topics: vec![]
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(0),
|
||||
event: SysEvent::ExtrinsicSuccess(Default::default()).into(),
|
||||
event: SysEvent::ExtrinsicSuccess { dispatch_info: Default::default() }.into(),
|
||||
topics: vec![]
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(1),
|
||||
event: SysEvent::ExtrinsicFailed(
|
||||
DispatchError::BadOrigin.into(),
|
||||
Default::default()
|
||||
)
|
||||
event: SysEvent::ExtrinsicFailed {
|
||||
dispatch_error: DispatchError::BadOrigin.into(),
|
||||
dispatch_info: Default::default()
|
||||
}
|
||||
.into(),
|
||||
topics: vec![]
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::Finalization,
|
||||
event: SysEvent::NewAccount(3).into(),
|
||||
event: SysEvent::NewAccount { account: 3 }.into(),
|
||||
topics: vec![]
|
||||
},
|
||||
]
|
||||
@@ -234,37 +234,34 @@ fn deposit_event_uses_actual_weight() {
|
||||
vec![
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(0),
|
||||
event: SysEvent::ExtrinsicSuccess(DispatchInfo {
|
||||
weight: 300,
|
||||
..Default::default()
|
||||
},)
|
||||
event: SysEvent::ExtrinsicSuccess {
|
||||
dispatch_info: DispatchInfo { weight: 300, ..Default::default() },
|
||||
}
|
||||
.into(),
|
||||
topics: vec![]
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(1),
|
||||
event: SysEvent::ExtrinsicSuccess(DispatchInfo {
|
||||
weight: 1000,
|
||||
..Default::default()
|
||||
},)
|
||||
event: SysEvent::ExtrinsicSuccess {
|
||||
dispatch_info: DispatchInfo { weight: 1000, ..Default::default() },
|
||||
}
|
||||
.into(),
|
||||
topics: vec![]
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(2),
|
||||
event: SysEvent::ExtrinsicSuccess(DispatchInfo {
|
||||
weight: 1000,
|
||||
..Default::default()
|
||||
},)
|
||||
event: SysEvent::ExtrinsicSuccess {
|
||||
dispatch_info: DispatchInfo { weight: 1000, ..Default::default() },
|
||||
}
|
||||
.into(),
|
||||
topics: vec![]
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(3),
|
||||
event: SysEvent::ExtrinsicFailed(
|
||||
DispatchError::BadOrigin.into(),
|
||||
DispatchInfo { weight: 999, ..Default::default() },
|
||||
)
|
||||
event: SysEvent::ExtrinsicFailed {
|
||||
dispatch_error: DispatchError::BadOrigin.into(),
|
||||
dispatch_info: DispatchInfo { weight: 999, ..Default::default() },
|
||||
}
|
||||
.into(),
|
||||
topics: vec![]
|
||||
},
|
||||
@@ -284,9 +281,9 @@ fn deposit_event_topics() {
|
||||
let topics = vec![H256::repeat_byte(1), H256::repeat_byte(2), H256::repeat_byte(3)];
|
||||
|
||||
// We deposit a few events with different sets of topics.
|
||||
System::deposit_event_indexed(&topics[0..3], SysEvent::NewAccount(1).into());
|
||||
System::deposit_event_indexed(&topics[0..1], SysEvent::NewAccount(2).into());
|
||||
System::deposit_event_indexed(&topics[1..2], SysEvent::NewAccount(3).into());
|
||||
System::deposit_event_indexed(&topics[0..3], SysEvent::NewAccount { account: 1 }.into());
|
||||
System::deposit_event_indexed(&topics[0..1], SysEvent::NewAccount { account: 2 }.into());
|
||||
System::deposit_event_indexed(&topics[1..2], SysEvent::NewAccount { account: 3 }.into());
|
||||
|
||||
System::finalize();
|
||||
|
||||
@@ -296,17 +293,17 @@ fn deposit_event_topics() {
|
||||
vec![
|
||||
EventRecord {
|
||||
phase: Phase::Finalization,
|
||||
event: SysEvent::NewAccount(1).into(),
|
||||
event: SysEvent::NewAccount { account: 1 }.into(),
|
||||
topics: topics[0..3].to_vec(),
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::Finalization,
|
||||
event: SysEvent::NewAccount(2).into(),
|
||||
event: SysEvent::NewAccount { account: 2 }.into(),
|
||||
topics: topics[0..1].to_vec(),
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::Finalization,
|
||||
event: SysEvent::NewAccount(3).into(),
|
||||
event: SysEvent::NewAccount { account: 3 }.into(),
|
||||
topics: topics[1..2].to_vec(),
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user