Skip to content

Commit

Permalink
Merge pull request #423 from gregdhill/chore/annuity-weight
Browse files Browse the repository at this point in the history
chore: add non-zero weight on annuity extrinsic
  • Loading branch information
gregdhill authored Dec 10, 2021
2 parents 73a8265 + a46d76c commit f80163b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/annuity/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ pub mod pallet {
// The pallet's dispatchable functions.
#[pallet::call]
impl<T: Config<I>, I: 'static> Pallet<T, I> {
#[pallet::weight(0)]
// TODO: add proper benchmarks, maybe use reward pallet directly
#[pallet::weight(100_000_000)]
#[transactional]
pub fn withdraw_reward(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
pub fn withdraw_rewards(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
let dest = ensure_signed(origin)?;
let value = T::BlockRewardProvider::withdraw_reward(&dest)?;
let _ = T::Currency::transfer(&Self::account_id(), &dest, value, ExistenceRequirement::KeepAlive);
Expand Down

0 comments on commit f80163b

Please sign in to comment.