Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
dudo50 committed Nov 3, 2024
1 parent f45a4f5 commit 48e38b0
Show file tree
Hide file tree
Showing 7 changed files with 1,574 additions and 1,367 deletions.
8 changes: 6 additions & 2 deletions templates/parachain/pallets/xcnft/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,9 @@ pub mod pallet {
// storage and emit event.
if unwrapped_proposal.number_of_votes.aye.len() < number_of_votes / 2 ||
unwrapped_proposal.number_of_votes.aye.len() == 0 &&
unwrapped_proposal.number_of_votes.nay.len() == 0 || unwrapped_proposal.number_of_votes.aye.len() == 0 && unwrapped_proposal.number_of_votes.nay.len() == 1
unwrapped_proposal.number_of_votes.nay.len() == 0 ||
unwrapped_proposal.number_of_votes.aye.len() == 0 &&
unwrapped_proposal.number_of_votes.nay.len() == 1
{
CrossChainProposals::<T, I>::remove(proposal_id);

Expand Down Expand Up @@ -1040,7 +1042,9 @@ pub mod pallet {

if proposal.number_of_votes.aye.len() < number_of_votes / 2 ||
proposal.number_of_votes.aye.len() == 0 &&
proposal.number_of_votes.nay.len() == 0 || proposal.number_of_votes.aye.len() == 0 && proposal.number_of_votes.nay.len() == 1
proposal.number_of_votes.nay.len() == 0 ||
proposal.number_of_votes.aye.len() == 0 &&
proposal.number_of_votes.nay.len() == 1
{
Self::deposit_event(Event::ProposalDidNotPass { proposal_id });

Expand Down
36 changes: 15 additions & 21 deletions templates/parachain/pallets/xcnft/src/mock.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
use frame_support::weights::constants::RocksDbWeight;
use frame_system::{mocking::MockBlock, GenesisConfig};
use sp_runtime::{traits::ConstU64, BuildStorage};
use frame_support::parameter_types;
use frame_support::{parameter_types, traits::VariantCountOf, weights::constants::RocksDbWeight};
use frame_system::{mocking::MockBlock, EnsureRoot, EnsureSigned, GenesisConfig};
use pallet_balances::AccountData;
use xcm_builder::WithUniqueTopic;
use sp_runtime::MultiSignature;
use sp_runtime::traits::Verify;
use frame_system::EnsureRoot;
use frame_system::EnsureSigned;
use sp_core::ConstU32;
use frame_support::traits::VariantCountOf;
use sp_runtime::AccountId32 as AccountId;
use sp_runtime::{
traits::{ConstU64, Verify},
AccountId32 as AccountId, BuildStorage, MultiSignature,
};
use xcm_builder::WithUniqueTopic;

pub type XcmRouter = WithUniqueTopic<(
(),
)>;
pub type XcmRouter = WithUniqueTopic<((),)>;

// Configure a mock runtime to test the pallet.
#[frame_support::runtime]
Expand All @@ -39,14 +33,14 @@ mod test_runtime {
#[runtime::pallet_index(1)]
pub type XcNFT = crate;

#[runtime::pallet_index(2)]
pub type Balances = pallet_balances;
#[runtime::pallet_index(2)]
pub type Balances = pallet_balances;

#[runtime::pallet_index(3)]
pub type NFTs = pallet_nfts;

#[runtime::pallet_index(4)]
pub type ParachainInfo = parachain_info;
#[runtime::pallet_index(4)]
pub type ParachainInfo = parachain_info;
}

/// Balance of an account.
Expand Down Expand Up @@ -88,7 +82,7 @@ impl frame_system::Config for Test {
impl parachain_info::Config for Test {}

impl crate::Config for Test {
type RuntimeEvent = RuntimeEvent;
type RuntimeEvent = RuntimeEvent;
type WeightInfo = ();
type XcmSender = XcmRouter;
type RuntimeCall = RuntimeCall;
Expand Down Expand Up @@ -119,10 +113,10 @@ impl pallet_balances::Config for Test {

parameter_types! {
pub const SS58Prefix: u16 = 42;
pub const ExistentialDeposit: u128 = 500;
pub const ExistentialDeposit: u128 = 500;
pub const CollectionDeposit: Balance = 0 * UNIT; // 1 UNIT deposit to create asset collection
pub const ItemDeposit: Balance = 0 * UNIT; // 1/100 UNIT deposit to create asset item
pub const KeyLimit: u32 = 32;
pub const KeyLimit: u32 = 32;
pub const ValueLimit: u32 = 64;
pub const UniquesMetadataDepositBase: Balance = 0 * UNIT;
pub const AttributeDepositBase: Balance = 0 * UNIT;
Expand Down
Loading

0 comments on commit 48e38b0

Please sign in to comment.