Pay trait gets Error item (#14258)

* `Pay` trait gets `Error` item

* Formatting
This commit is contained in:
Gavin Wood
2023-05-29 15:29:51 +01:00
committed by GitHub
parent cb533ffa98
commit c40a4cc139
3 changed files with 11 additions and 6 deletions
+2 -2
View File
@@ -436,8 +436,8 @@ pub mod pallet {
claimant.last_active = status.cycle_index;
let id = T::Paymaster::pay(&beneficiary, (), payout)
.map_err(|()| Error::<T, I>::PayError)?;
let id =
T::Paymaster::pay(&beneficiary, (), payout).map_err(|_| Error::<T, I>::PayError)?;
claimant.status = Attempted { registered, id, amount: payout };
+2 -1
View File
@@ -103,12 +103,13 @@ impl Pay for TestPay {
type Balance = u64;
type Id = u64;
type AssetKind = ();
type Error = ();
fn pay(
who: &Self::Beneficiary,
_: Self::AssetKind,
amount: Self::Balance,
) -> Result<Self::Id, ()> {
) -> Result<Self::Id, Self::Error> {
PAID.with(|paid| *paid.borrow_mut().entry(*who).or_default() += amount);
Ok(LAST_ID.with(|lid| {
let x = *lid.borrow();