From 32fcd46454e3d67ea6a2c6e5ddac349c8b4396cf Mon Sep 17 00:00:00 2001 From: Sergei Shulepov <sergei@parity.io> Date: Mon, 3 Jan 2022 20:28:42 +0100 Subject: [PATCH] Derive Clone for RelayStateSproofBuilder (#884) --- cumulus/test/relay-sproof-builder/src/lib.rs | 21 +------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/cumulus/test/relay-sproof-builder/src/lib.rs b/cumulus/test/relay-sproof-builder/src/lib.rs index 8345e434713..30a576b71c2 100644 --- a/cumulus/test/relay-sproof-builder/src/lib.rs +++ b/cumulus/test/relay-sproof-builder/src/lib.rs @@ -23,6 +23,7 @@ use sp_state_machine::MemoryDB; use sp_std::collections::btree_map::BTreeMap; /// Builds a sproof (portmanteau of 'spoof' and 'proof') of the relay chain state. +#[derive(Clone)] pub struct RelayStateSproofBuilder { /// The para id of the current parachain. /// @@ -70,26 +71,6 @@ impl Default for RelayStateSproofBuilder { } } -// TODO: derive `Copy` and `Clone` for `UpgradeGoAhead` to avoid manual implementation. -impl Clone for RelayStateSproofBuilder { - fn clone(&self) -> Self { - RelayStateSproofBuilder { - para_id: self.para_id, - host_config: self.host_config.clone(), - dmq_mqc_head: self.dmq_mqc_head.clone(), - upgrade_go_ahead: self.upgrade_go_ahead.as_ref().map(|u| match u { - UpgradeGoAhead::Abort => UpgradeGoAhead::Abort, - UpgradeGoAhead::GoAhead => UpgradeGoAhead::GoAhead, - }), - relay_dispatch_queue_size: self.relay_dispatch_queue_size, - hrmp_ingress_channel_index: self.hrmp_ingress_channel_index.clone(), - hrmp_egress_channel_index: self.hrmp_egress_channel_index.clone(), - hrmp_channels: self.hrmp_channels.clone(), - current_slot: self.current_slot.clone(), - } - } -} - impl RelayStateSproofBuilder { /// Returns a mutable reference to HRMP channel metadata for a channel (`sender`, `self.para_id`). /// -- GitLab