Use same fmt and clippy configs as in Polkadot (#3004)

* Copy rustfmt.toml from Polkadot master

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Format with new config

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add Polkadot clippy config

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update Cargo.lock

Looks like https://github.com/paritytech/polkadot/pull/7611 did not
correctly update the lockfile. Maybe a different Rust Version?!

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
Oliver Tale-Yazdi
2023-08-14 22:30:12 +02:00
committed by GitHub
parent 61480a1881
commit 6c79b58567
60 changed files with 333 additions and 233 deletions
@@ -163,7 +163,8 @@ pub type Barrier = TrailingSetTopicAsId<
AllowKnownQueryResponses<PolkadotXcm>,
WithComputedOrigin<
(
// If the message is one that immediately attemps to pay for execution, then allow it.
// If the message is one that immediately attemps to pay for execution, then
// allow it.
AllowTopLevelPaidExecutionFrom<Everything>,
// Parent and its pluralities (i.e. governance bodies) get free execution.
AllowExplicitUnpaidExecutionFrom<ParentOrParentsPlurality>,
@@ -166,9 +166,11 @@ pub type Barrier = TrailingSetTopicAsId<
AllowKnownQueryResponses<PolkadotXcm>,
WithComputedOrigin<
(
// If the message is one that immediately attemps to pay for execution, then allow it.
// If the message is one that immediately attemps to pay for execution, then
// allow it.
AllowTopLevelPaidExecutionFrom<Everything>,
// Parent, its pluralities (i.e. governance bodies), and the Fellows plurality get free execution.
// Parent, its pluralities (i.e. governance bodies), and the Fellows plurality
// get free execution.
AllowExplicitUnpaidExecutionFrom<(ParentOrParentsPlurality, FellowsPlurality)>,
// Subscriptions for version tracking are OK.
AllowSubscriptionsFrom<ParentOrSiblings>,
@@ -207,7 +207,8 @@ pub type Barrier = TrailingSetTopicAsId<
AllowKnownQueryResponses<PolkadotXcm>,
WithComputedOrigin<
(
// If the message is one that immediately attemps to pay for execution, then allow it.
// If the message is one that immediately attemps to pay for execution, then
// allow it.
AllowTopLevelPaidExecutionFrom<Everything>,
// Parent and its pluralities (i.e. governance bodies) get free execution.
AllowExplicitUnpaidExecutionFrom<ParentOrParentsPlurality>,
@@ -230,8 +231,8 @@ impl xcm_executor::Config for XcmConfig {
type XcmSender = XcmRouter;
type AssetTransactor = CurrencyTransactor;
type OriginConverter = XcmOriginToTransactDispatchOrigin;
// BridgeHub does not recognize a reserve location for any asset. Users must teleport Native token
// where allowed (e.g. with the Relay Chain).
// BridgeHub does not recognize a reserve location for any asset. Users must teleport Native
// token where allowed (e.g. with the Relay Chain).
type IsReserve = ();
/// Only allow teleportation of NativeToken of relay chain.
type IsTeleporter = ConcreteNativeAssetFrom<RelayLocation>;
@@ -317,7 +318,8 @@ impl cumulus_pallet_xcm::Config for Runtime {
type XcmExecutor = XcmExecutor<XcmConfig>;
}
/// Hacky switch implementation, because we have just one runtime for Rococo and Wococo BridgeHub, so it means we have just one XcmConfig
/// Hacky switch implementation, because we have just one runtime for Rococo and Wococo BridgeHub,
/// so it means we have just one XcmConfig
pub struct BridgeHubRococoOrBridgeHubWococoSwitchExporter;
impl ExportXcm for BridgeHubRococoOrBridgeHubWococoSwitchExporter {
type Ticket = (NetworkId, (sp_std::prelude::Vec<u8>, XcmHash));
@@ -243,7 +243,8 @@ pub fn message_dispatch_routing_works<
HrmpChannelOpener: frame_support::inherent::ProvideInherent<
Call = cumulus_pallet_parachain_system::Call<Runtime>,
>,
// MessageDispatcher: MessageDispatch<AccountIdOf<Runtime>, DispatchLevelResult = XcmBlobMessageDispatchResult, DispatchPayload = XcmAsPlainPayload>,
// MessageDispatcher: MessageDispatch<AccountIdOf<Runtime>, DispatchLevelResult =
// XcmBlobMessageDispatchResult, DispatchPayload = XcmAsPlainPayload>,
RuntimeNetwork: Get<NetworkId>,
BridgedNetwork: Get<NetworkId>,
{
@@ -839,7 +840,8 @@ pub mod test_data {
)
}
/// Helper that creates InitializationData mock data, that can be used to initialize bridge GRANDPA pallet
/// Helper that creates InitializationData mock data, that can be used to initialize bridge
/// GRANDPA pallet
pub fn initialization_data<
Runtime: pallet_bridge_grandpa::Config<GrandpaPalletInstance>,
GrandpaPalletInstance: 'static,