style: Migrate to stable-only rustfmt configuration
- Remove nightly-only features from .rustfmt.toml and vendor/ss58-registry/rustfmt.toml - Removed features: imports_granularity, wrap_comments, comment_width, reorder_impl_items, spaces_around_ranges, binop_separator, match_arm_blocks, trailing_semicolon, trailing_comma - Format all 898 affected files with stable rustfmt - Ensures long-term reliability without nightly toolchain dependency
This commit is contained in:
@@ -272,16 +272,19 @@ pub fn set_status<T: Config<I>, I: 'static>(
|
||||
.expect("no bounty");
|
||||
|
||||
let new_status = match bounty.3 {
|
||||
BountyStatus::FundingAttempted { curator, .. } =>
|
||||
BountyStatus::FundingAttempted { payment_status: new_payment_status, curator },
|
||||
BountyStatus::RefundAttempted { curator, .. } =>
|
||||
BountyStatus::RefundAttempted { payment_status: new_payment_status, curator },
|
||||
BountyStatus::PayoutAttempted { curator, beneficiary, .. } =>
|
||||
BountyStatus::FundingAttempted { curator, .. } => {
|
||||
BountyStatus::FundingAttempted { payment_status: new_payment_status, curator }
|
||||
},
|
||||
BountyStatus::RefundAttempted { curator, .. } => {
|
||||
BountyStatus::RefundAttempted { payment_status: new_payment_status, curator }
|
||||
},
|
||||
BountyStatus::PayoutAttempted { curator, beneficiary, .. } => {
|
||||
BountyStatus::PayoutAttempted {
|
||||
payment_status: new_payment_status,
|
||||
curator,
|
||||
beneficiary,
|
||||
},
|
||||
}
|
||||
},
|
||||
_ => return Err(BenchmarkError::Stop("unexpected bounty status")),
|
||||
};
|
||||
|
||||
|
||||
@@ -663,8 +663,8 @@ pub mod pezpallet {
|
||||
Error::<T, I>::InvalidValue
|
||||
);
|
||||
ensure!(
|
||||
ChildBountiesPerParent::<T, I>::get(parent_bounty_id) <
|
||||
T::MaxActiveChildBountyCount::get() as u32,
|
||||
ChildBountiesPerParent::<T, I>::get(parent_bounty_id)
|
||||
< T::MaxActiveChildBountyCount::get() as u32,
|
||||
Error::<T, I>::TooManyChildBounties,
|
||||
);
|
||||
|
||||
@@ -898,8 +898,8 @@ pub mod pezpallet {
|
||||
// curator can unassign the child-/bounty curator.
|
||||
ensure!(
|
||||
maybe_sender.map_or(true, |sender| {
|
||||
sender == *curator ||
|
||||
parent_curator
|
||||
sender == *curator
|
||||
|| parent_curator
|
||||
.map_or(false, |parent_curator| sender == parent_curator)
|
||||
}),
|
||||
BadOrigin
|
||||
@@ -1070,8 +1070,9 @@ pub mod pezpallet {
|
||||
Self::get_bounty_details(parent_bounty_id, child_bounty_id)?;
|
||||
|
||||
let maybe_curator = match status {
|
||||
BountyStatus::Funded { curator } | BountyStatus::Active { curator, .. } =>
|
||||
Some(curator),
|
||||
BountyStatus::Funded { curator } | BountyStatus::Active { curator, .. } => {
|
||||
Some(curator)
|
||||
},
|
||||
BountyStatus::CuratorUnassigned => None,
|
||||
_ => return Err(Error::<T, I>::UnexpectedStatus.into()),
|
||||
};
|
||||
@@ -1174,13 +1175,14 @@ pub mod pezpallet {
|
||||
|
||||
let new_status = match new_payment_status {
|
||||
PaymentState::Succeeded => match (child_bounty_id, parent_curator) {
|
||||
(Some(_), Some(parent_curator)) if curator == parent_curator =>
|
||||
BountyStatus::Active { curator },
|
||||
(Some(_), Some(parent_curator)) if curator == parent_curator => {
|
||||
BountyStatus::Active { curator }
|
||||
},
|
||||
_ => BountyStatus::Funded { curator },
|
||||
},
|
||||
PaymentState::Pending |
|
||||
PaymentState::Failed |
|
||||
PaymentState::Attempted { .. } => BountyStatus::FundingAttempted {
|
||||
PaymentState::Pending
|
||||
| PaymentState::Failed
|
||||
| PaymentState::Attempted { .. } => BountyStatus::FundingAttempted {
|
||||
payment_status: new_payment_status,
|
||||
curator,
|
||||
},
|
||||
@@ -1220,9 +1222,9 @@ pub mod pezpallet {
|
||||
Self::remove_bounty(parent_bounty_id, child_bounty_id, metadata);
|
||||
return Ok(Pays::No.into());
|
||||
},
|
||||
PaymentState::Pending |
|
||||
PaymentState::Failed |
|
||||
PaymentState::Attempted { .. } => BountyStatus::RefundAttempted {
|
||||
PaymentState::Pending
|
||||
| PaymentState::Failed
|
||||
| PaymentState::Attempted { .. } => BountyStatus::RefundAttempted {
|
||||
payment_status: new_payment_status,
|
||||
curator: curator.clone(),
|
||||
},
|
||||
@@ -1256,9 +1258,9 @@ pub mod pezpallet {
|
||||
Self::remove_bounty(parent_bounty_id, child_bounty_id, metadata);
|
||||
return Ok(Pays::No.into());
|
||||
},
|
||||
PaymentState::Pending |
|
||||
PaymentState::Failed |
|
||||
PaymentState::Attempted { .. } => BountyStatus::PayoutAttempted {
|
||||
PaymentState::Pending
|
||||
| PaymentState::Failed
|
||||
| PaymentState::Attempted { .. } => BountyStatus::PayoutAttempted {
|
||||
curator: curator.clone(),
|
||||
beneficiary: beneficiary.clone(),
|
||||
payment_status: new_payment_status.clone(),
|
||||
@@ -1629,8 +1631,9 @@ impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
|
||||
});
|
||||
Ok(PaymentState::Succeeded)
|
||||
},
|
||||
PaymentStatus::InProgress | PaymentStatus::Unknown =>
|
||||
return Err(Error::<T, I>::FundingInconclusive.into()),
|
||||
PaymentStatus::InProgress | PaymentStatus::Unknown => {
|
||||
return Err(Error::<T, I>::FundingInconclusive.into())
|
||||
},
|
||||
PaymentStatus::Failure => {
|
||||
Self::deposit_event(Event::<T, I>::PaymentFailed {
|
||||
index: parent_bounty_id,
|
||||
@@ -1697,7 +1700,9 @@ impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
|
||||
},
|
||||
PaymentStatus::InProgress | PaymentStatus::Unknown =>
|
||||
// nothing new to report
|
||||
Err(Error::<T, I>::RefundInconclusive.into()),
|
||||
{
|
||||
Err(Error::<T, I>::RefundInconclusive.into())
|
||||
},
|
||||
PaymentStatus::Failure => {
|
||||
// assume payment has failed, allow user to retry
|
||||
Self::deposit_event(Event::<T, I>::PaymentFailed {
|
||||
@@ -1727,8 +1732,9 @@ impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
|
||||
|
||||
let source = match child_bounty_id {
|
||||
None => Self::bounty_account(parent_bounty_id, asset_kind.clone())?,
|
||||
Some(child_bounty_id) =>
|
||||
Self::child_bounty_account(parent_bounty_id, child_bounty_id, asset_kind.clone())?,
|
||||
Some(child_bounty_id) => {
|
||||
Self::child_bounty_account(parent_bounty_id, child_bounty_id, asset_kind.clone())?
|
||||
},
|
||||
};
|
||||
|
||||
let id = <T as Config<I>>::Paymaster::pay(&source, &beneficiary, asset_kind, payout)
|
||||
@@ -1771,7 +1777,9 @@ impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
|
||||
},
|
||||
PaymentStatus::InProgress | PaymentStatus::Unknown =>
|
||||
// nothing new to report
|
||||
Err(Error::<T, I>::PayoutInconclusive.into()),
|
||||
{
|
||||
Err(Error::<T, I>::PayoutInconclusive.into())
|
||||
},
|
||||
PaymentStatus::Failure => {
|
||||
// assume payment has failed, allow user to retry
|
||||
Self::deposit_event(Event::<T, I>::PaymentFailed {
|
||||
|
||||
Reference in New Issue
Block a user