mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-22 14:55:41 +00:00
Add field names to pallet Event variants (#9993)
* convert pallet-assets events to struct types * updated events of a couple pallets * updated pallet event field names * update pallet event field names * updated events in test files * cargo fmt * minorfixes * fix assertion error * minor fix * formatting fix * fmt
This commit is contained in:
@@ -218,13 +218,12 @@ pub mod pallet {
|
||||
#[pallet::event]
|
||||
#[pallet::generate_deposit(pub(super) fn deposit_event)]
|
||||
pub enum Event<T: Config> {
|
||||
/// Swap created. \[account, proof, swap\]
|
||||
NewSwap(T::AccountId, HashedProof, PendingSwap<T>),
|
||||
/// Swap created.
|
||||
NewSwap { account: T::AccountId, proof: HashedProof, swap: PendingSwap<T> },
|
||||
/// Swap claimed. The last parameter indicates whether the execution succeeds.
|
||||
/// \[account, proof, success\]
|
||||
SwapClaimed(T::AccountId, HashedProof, bool),
|
||||
/// Swap cancelled. \[account, proof\]
|
||||
SwapCancelled(T::AccountId, HashedProof),
|
||||
SwapClaimed { account: T::AccountId, proof: HashedProof, success: bool },
|
||||
/// Swap cancelled.
|
||||
SwapCancelled { account: T::AccountId, proof: HashedProof },
|
||||
}
|
||||
|
||||
/// Old name generated by `decl_event`.
|
||||
@@ -268,7 +267,7 @@ pub mod pallet {
|
||||
};
|
||||
PendingSwaps::<T>::insert(target.clone(), hashed_proof.clone(), swap.clone());
|
||||
|
||||
Self::deposit_event(Event::NewSwap(target, hashed_proof, swap));
|
||||
Self::deposit_event(Event::NewSwap { account: target, proof: hashed_proof, swap });
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -304,7 +303,11 @@ pub mod pallet {
|
||||
|
||||
PendingSwaps::<T>::remove(target.clone(), hashed_proof.clone());
|
||||
|
||||
Self::deposit_event(Event::SwapClaimed(target, hashed_proof, succeeded));
|
||||
Self::deposit_event(Event::SwapClaimed {
|
||||
account: target,
|
||||
proof: hashed_proof,
|
||||
success: succeeded,
|
||||
});
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -333,7 +336,7 @@ pub mod pallet {
|
||||
swap.action.cancel(&swap.source);
|
||||
PendingSwaps::<T>::remove(&target, hashed_proof.clone());
|
||||
|
||||
Self::deposit_event(Event::SwapCancelled(target, hashed_proof));
|
||||
Self::deposit_event(Event::SwapCancelled { account: target, proof: hashed_proof });
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user