From d5ef412a834021cd0b5822db5eb4b2f259fb50d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Andr=C3=A9s=20Dorado=20Su=C3=A1rez?= Date: Wed, 22 Nov 2023 11:06:15 -0500 Subject: [PATCH] fix: lint + fmt --- node/src/rpc.rs | 3 +- node/src/service.rs | 3 +- .../src/functions/governance/mod.rs | 1 - .../src/functions/governance/tracks.rs | 43 ------------------- .../src/functions/validation/challenges.rs | 1 + pallets/communities/src/tests/mock/mod.rs | 2 - pallets/communities/src/traits/validation.rs | 1 + pallets/payments/src/lib.rs | 2 +- runtime/kreivo/src/weights/mod.rs | 2 - 9 files changed, 7 insertions(+), 51 deletions(-) delete mode 100644 pallets/communities/src/functions/governance/tracks.rs diff --git a/node/src/rpc.rs b/node/src/rpc.rs index fae3d9a8..1e6b5f7e 100644 --- a/node/src/rpc.rs +++ b/node/src/rpc.rs @@ -22,7 +22,8 @@ use std::sync::Arc; use parachains_common::{AccountId, Balance, Block, Nonce}; use sc_client_api::AuxStore; -pub use sc_rpc::{DenyUnsafe, SubscriptionTaskExecutor}; +pub use sc_rpc::DenyUnsafe; +// pub use sc_rpc::SubscriptionTaskExecutor; use sc_transaction_pool_api::TransactionPool; use sp_api::ProvideRuntimeApi; use sp_block_builder::BlockBuilder; diff --git a/node/src/service.rs b/node/src/service.rs index 46677db9..774f19cd 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -36,7 +36,8 @@ use cumulus_primitives_core::{ use cumulus_relay_chain_interface::{OverseerHandle, RelayChainInterface}; use futures::lock::Mutex; use jsonrpsee::RpcModule; -pub use parachains_common::{AccountId, AssetIdForTrustBackedAssets as AssetId, Balance, Block, Hash, Header, Nonce}; +// pub use parachains_common::AssetIdForTrustBackedAssets as AssetId; +pub use parachains_common::{AccountId, Balance, Block, Hash, Header, Nonce}; use parity_scale_codec::Codec; use sc_consensus::{ import_queue::{BasicQueue, Verifier as VerifierT}, diff --git a/pallets/communities/src/functions/governance/mod.rs b/pallets/communities/src/functions/governance/mod.rs index d79aaa40..e44fab09 100644 --- a/pallets/communities/src/functions/governance/mod.rs +++ b/pallets/communities/src/functions/governance/mod.rs @@ -1,4 +1,3 @@ use super::*; mod tally; -mod tracks; diff --git a/pallets/communities/src/functions/governance/tracks.rs b/pallets/communities/src/functions/governance/tracks.rs deleted file mode 100644 index 6565c3af..00000000 --- a/pallets/communities/src/functions/governance/tracks.rs +++ /dev/null @@ -1,43 +0,0 @@ -use super::*; - -use pallet_referenda::{Track, TracksInfo}; -use sp_std::borrow::Cow; - -// #[cfg(feature = "referenda")] -impl TracksInfo> for CommunityTracks { - type Id = T::CommunityId; - type RuntimeOrigin = RuntimeOriginOf; - - fn tracks() -> impl Iterator>>> { - //TODO: Convert from a list of community IDs to list of tracks" - - // Info::::iter_keys().map(|community_id| Track { - // id: community_id, - // info: TrackInfo { - // name: "".into(), - // max_deciding: 0, - // decision_deposit: 0, - // prepare_period: 100, - // decision_period: 100, - // confirm_period: 100, - // min_enactment_period: 100, - // min_approval: pallet_referenda::Curve::LinearDecreasing { - // length: 1.into(), - // floor: 1.into(), - // ceil: 1.into(), - // }, - // min_support: pallet_referenda::Curve::LinearDecreasing { - // length: 1.into(), - // floor: 1.into(), - // ceil: 1.into(), - // }, - // }, - // }) - - vec![].into_iter() - } - - fn track_for(_origin: &Self::RuntimeOrigin) -> Result { - todo!("Convert the signed as community account id into the track Id for the community track") - } -} diff --git a/pallets/communities/src/functions/validation/challenges.rs b/pallets/communities/src/functions/validation/challenges.rs index 5b67f1a4..66028cb3 100644 --- a/pallets/communities/src/functions/validation/challenges.rs +++ b/pallets/communities/src/functions/validation/challenges.rs @@ -1,6 +1,7 @@ use super::*; use crate::traits::validation::{ChallengeRegistrationRejectionCause, ValidationChallenge, ValidationRejectionCause}; +use sp_std::vec::Vec; impl ValidationChallenge for Pallet { type EntityId = T::CommunityId; diff --git a/pallets/communities/src/tests/mock/mod.rs b/pallets/communities/src/tests/mock/mod.rs index 1b716f45..87516653 100644 --- a/pallets/communities/src/tests/mock/mod.rs +++ b/pallets/communities/src/tests/mock/mod.rs @@ -24,7 +24,6 @@ use crate::{ }; pub(super) use challenger::Challenger; -use poll::TestPolls; type Block = frame_system::mocking::MockBlock; type WeightInfo = (); @@ -121,7 +120,6 @@ impl pallet_balances::Config for Test { type FreezeIdentifier = (); type MaxHolds = ConstU32<10>; type MaxFreezes = ConstU32<10>; - type RuntimeFreezeReason = (); } parameter_types! { diff --git a/pallets/communities/src/traits/validation.rs b/pallets/communities/src/traits/validation.rs index f0ce1247..08c83490 100644 --- a/pallets/communities/src/traits/validation.rs +++ b/pallets/communities/src/traits/validation.rs @@ -4,6 +4,7 @@ use frame_support::{ }; use parity_scale_codec::MaxEncodedLen; use sp_runtime::traits::Saturating; +use sp_std::vec::Vec; #[derive(Debug, Encode, Decode)] pub enum ChallengeRegistrationRejectionCause { diff --git a/pallets/payments/src/lib.rs b/pallets/payments/src/lib.rs index 028f020e..ecb409cd 100644 --- a/pallets/payments/src/lib.rs +++ b/pallets/payments/src/lib.rs @@ -430,7 +430,7 @@ pub mod pallet { let payment = maybe_payment.as_mut().map_err(|_| Error::::InvalidPayment)?; // ensure the payment is in Requested Refund state - let RefundRequested {cancel_block} = payment.state else { + let RefundRequested { cancel_block } = payment.state else { fail!(Error::::InvalidAction); }; ensure!( diff --git a/runtime/kreivo/src/weights/mod.rs b/runtime/kreivo/src/weights/mod.rs index 79758803..c4cd190c 100644 --- a/runtime/kreivo/src/weights/mod.rs +++ b/runtime/kreivo/src/weights/mod.rs @@ -27,5 +27,3 @@ pub mod xcm; pub use block_weights::constants::BlockExecutionWeight; pub use extrinsic_weights::constants::ExtrinsicBaseWeight; -pub use paritydb_weights::constants::ParityDbWeight; -pub use rocksdb_weights::constants::RocksDbWeight;