PaysFee for DispatchInfo (#4165)

* Add PaysFee trait

* bump version

* Apply suggestions from code review

Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* line width

* Apply suggestions from code review

Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* fix test

* fix test

* fix test
This commit is contained in:
Xiliang Chen
2019-11-25 19:42:51 +13:00
committed by Kian Paimani
parent 68818929ab
commit 04571d958b
7 changed files with 81 additions and 54 deletions
+7 -1
View File
@@ -256,7 +256,7 @@
use rstd::marker::PhantomData;
use support::{
dispatch::Result, decl_module, decl_storage, decl_event,
weights::{SimpleDispatchInfo, DispatchInfo, DispatchClass, ClassifyDispatch, WeighData, Weight},
weights::{SimpleDispatchInfo, DispatchInfo, DispatchClass, ClassifyDispatch, WeighData, Weight, PaysFee},
};
use system::{ensure_signed, ensure_root};
use codec::{Encode, Decode};
@@ -301,6 +301,12 @@ impl<T: balances::Trait> ClassifyDispatch<(&BalanceOf<T>,)> for WeightForSetDumm
}
}
impl<T: balances::Trait> PaysFee for WeightForSetDummy<T> {
fn pays_fee(&self) -> bool {
true
}
}
/// A type alias for the balance type from this module's point of view.
type BalanceOf<T> = <T as balances::Trait>::Balance;