mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 05:51:02 +00:00
Add event field names to HRMP Event variants (#1695)
Update the HRMP pallet to use field names for Event variants to improve metadata for a better client experience. Event variants are now structs instead of unnamed tuples. Partially implements Substrate issue [9903](https://github.com/paritytech/substrate/issues/9903) which doesn't appear to have been moved to the monorepo.
This commit is contained in:
+12
-2
@@ -37,7 +37,12 @@ tests:
|
||||
]
|
||||
events:
|
||||
- name: hrmp.HrmpChannelForceOpened
|
||||
result: [*cp_id, *sp_id, *hrmp_proposed_max_capacity, *hrmp_proposed_max_message_size]
|
||||
result: {
|
||||
sender: *cp_id,
|
||||
recipient: *sp_id,
|
||||
proposed_max_capacity: *hrmp_proposed_max_capacity,
|
||||
proposed_max_message_size: *hrmp_proposed_max_message_size
|
||||
}
|
||||
- name: Force Open HRMP Channel From AssetHub Parachain → Collectives Parachain
|
||||
its:
|
||||
- name: Alice calls hrmp.forceOpenHrmpChannel
|
||||
@@ -56,4 +61,9 @@ tests:
|
||||
]
|
||||
events:
|
||||
- name: hrmp.HrmpChannelForceOpened
|
||||
result: [*sp_id, *cp_id, *hrmp_proposed_max_capacity, *hrmp_proposed_max_message_size]
|
||||
result: {
|
||||
sender: *sp_id,
|
||||
recipient: *cp_id,
|
||||
proposed_max_capacity: *hrmp_proposed_max_capacity,
|
||||
proposed_max_message_size: *hrmp_proposed_max_message_size
|
||||
}
|
||||
|
||||
+14
-8
@@ -79,9 +79,12 @@ fn open_hrmp_channel_between_paras_works() {
|
||||
},
|
||||
// Open channel requested from Para A to Para B
|
||||
RuntimeEvent::Hrmp(
|
||||
polkadot_runtime_parachains::hrmp::Event::OpenChannelRequested(
|
||||
sender, recipient, max_capacity, max_message_size
|
||||
)
|
||||
polkadot_runtime_parachains::hrmp::Event::OpenChannelRequested {
|
||||
sender,
|
||||
recipient,
|
||||
proposed_max_capacity: max_capacity,
|
||||
proposed_max_message_size: max_message_size
|
||||
}
|
||||
) => {
|
||||
sender: *sender == para_a_id.into(),
|
||||
recipient: *recipient == para_b_id.into(),
|
||||
@@ -133,9 +136,9 @@ fn open_hrmp_channel_between_paras_works() {
|
||||
},
|
||||
// Open channel accepted for Para A to Para B
|
||||
RuntimeEvent::Hrmp(
|
||||
polkadot_runtime_parachains::hrmp::Event::OpenChannelAccepted(
|
||||
polkadot_runtime_parachains::hrmp::Event::OpenChannelAccepted {
|
||||
sender, recipient
|
||||
)
|
||||
}
|
||||
) => {
|
||||
sender: *sender == para_a_id.into(),
|
||||
recipient: *recipient == para_b_id.into(),
|
||||
@@ -175,9 +178,12 @@ fn force_open_hrmp_channel_for_system_para_works() {
|
||||
vec![
|
||||
// HRMP channel forced opened
|
||||
RuntimeEvent::Hrmp(
|
||||
polkadot_runtime_parachains::hrmp::Event::HrmpChannelForceOpened(
|
||||
sender, recipient, max_capacity, max_message_size
|
||||
)
|
||||
polkadot_runtime_parachains::hrmp::Event::HrmpChannelForceOpened{
|
||||
sender,
|
||||
recipient,
|
||||
proposed_max_capacity: max_capacity,
|
||||
proposed_max_message_size: max_message_size
|
||||
}
|
||||
) => {
|
||||
sender: *sender == system_para_id.into(),
|
||||
recipient: *recipient == para_a_id.into(),
|
||||
|
||||
+8
-8
@@ -79,9 +79,9 @@ fn open_hrmp_channel_between_paras_works() {
|
||||
},
|
||||
// Open channel requested from Para A to Para B
|
||||
RuntimeEvent::Hrmp(
|
||||
polkadot_runtime_parachains::hrmp::Event::OpenChannelRequested(
|
||||
sender, recipient, max_capacity, max_message_size
|
||||
)
|
||||
polkadot_runtime_parachains::hrmp::Event::OpenChannelRequested {
|
||||
sender, recipient, proposed_max_capacity: max_capacity, proposed_max_message_size: max_message_size
|
||||
}
|
||||
) => {
|
||||
sender: *sender == para_a_id.into(),
|
||||
recipient: *recipient == para_b_id.into(),
|
||||
@@ -133,9 +133,9 @@ fn open_hrmp_channel_between_paras_works() {
|
||||
},
|
||||
// Open channel accepted for Para A to Para B
|
||||
RuntimeEvent::Hrmp(
|
||||
polkadot_runtime_parachains::hrmp::Event::OpenChannelAccepted(
|
||||
polkadot_runtime_parachains::hrmp::Event::OpenChannelAccepted {
|
||||
sender, recipient
|
||||
)
|
||||
}
|
||||
) => {
|
||||
sender: *sender == para_a_id.into(),
|
||||
recipient: *recipient == para_b_id.into(),
|
||||
@@ -175,9 +175,9 @@ fn force_open_hrmp_channel_for_system_para_works() {
|
||||
vec![
|
||||
// HRMP channel forced opened
|
||||
RuntimeEvent::Hrmp(
|
||||
polkadot_runtime_parachains::hrmp::Event::HrmpChannelForceOpened(
|
||||
sender, recipient, max_capacity, max_message_size
|
||||
)
|
||||
polkadot_runtime_parachains::hrmp::Event::HrmpChannelForceOpened{
|
||||
sender, recipient, proposed_max_capacity: max_capacity, proposed_max_message_size: max_message_size
|
||||
}
|
||||
) => {
|
||||
sender: *sender == system_para_id.into(),
|
||||
recipient: *recipient == para_a_id.into(),
|
||||
|
||||
Reference in New Issue
Block a user