Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
ndkazu committed Jan 11, 2025
1 parent e8a8f90 commit 1b1d4d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
7 changes: 2 additions & 5 deletions substrate/frame/opf/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,11 @@ impl<T: Config> Pallet<T> {

pub fn convert_balance(amount: BalanceOf<T>) -> Option<BalanceOfD<T>> {
let value = match TryInto::<u128>::try_into(amount) {
Ok(val) => {
TryInto::<BalanceOfD<T>>::try_into(val).ok()
},
Err(e) => None
Ok(val) => TryInto::<BalanceOfD<T>>::try_into(val).ok(),
Err(e) => None,
};

value

}
/// Funds transfer from the Pot to a project account
pub fn spend(amount: BalanceOf<T>, beneficiary: AccountIdOf<T>) -> DispatchResult {
Expand Down
14 changes: 6 additions & 8 deletions substrate/frame/opf/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ pub use frame_support::{
dispatch::GetDispatchInfo,
pallet_prelude::*,
traits::{
fungible, Currency,
fungible,
fungible::{Inspect, InspectHold, Mutate, MutateHold},
fungibles,
schedule::{
v3::{Anon as ScheduleAnon, Named as ScheduleNamed},
DispatchTime, MaybeHashed,
},
tokens::{Precision, Preservation},
Bounded, DefensiveOption, EnsureOrigin, LockIdentifier, OriginTrait, QueryPreimage,
StorePreimage, UnfilteredDispatchable,
Bounded, Currency, DefensiveOption, EnsureOrigin, LockIdentifier, OriginTrait,
QueryPreimage, StorePreimage, UnfilteredDispatchable,
},
transactional,
weights::{WeightMeter, WeightToFee},
Expand All @@ -53,7 +53,9 @@ pub type BalanceOf<T> = <<T as Config>::NativeBalance as fungible::Inspect<
<T as frame_system::Config>::AccountId,
>>::Balance;

pub type BalanceOfD<T> = <<T as Democracy::Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance;
pub type BalanceOfD<T> = <<T as Democracy::Config>::Currency as Currency<
<T as frame_system::Config>::AccountId,
>>::Balance;

pub type AccountIdOf<T> = <T as frame_system::Config>::AccountId;
/// A reward index.
Expand Down Expand Up @@ -226,7 +228,3 @@ impl<T: Config> VotingRoundInfo<T> {
round_infos
}
}




0 comments on commit 1b1d4d6

Please sign in to comment.