Rename pallet trait Trait to Config (#7599)

* rename Trait to Config

* add test asserting using Trait is still valid.

* fix ui tests
This commit is contained in:
Guillaume Thiolliere
2020-11-30 15:34:54 +01:00
committed by GitHub
parent dd3c84c362
commit 1cbfc9257f
200 changed files with 1767 additions and 1607 deletions
+4 -4
View File
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
use crate::Trait;
use crate::Config;
use sp_std::marker::PhantomData;
use sp_runtime::traits::Zero;
use frame_support::dispatch::{
@@ -60,7 +60,7 @@ impl<T: Any + Debug + PartialEq + Eq> TestAuxiliaries for T {}
/// Implementing type is expected to be super lightweight hence `Copy` (`Clone` is added
/// for consistency). If inlined there should be no observable difference compared
/// to a hand-written code.
pub trait Token<T: Trait>: Copy + Clone + TestAuxiliaries {
pub trait Token<T: Config>: Copy + Clone + TestAuxiliaries {
/// Metadata type, which the token can require for calculating the amount
/// of gas to charge. Can be a some configuration type or
/// just the `()`.
@@ -84,7 +84,7 @@ pub struct ErasedToken {
pub token: Box<dyn Any>,
}
pub struct GasMeter<T: Trait> {
pub struct GasMeter<T: Config> {
gas_limit: Gas,
/// Amount of gas left from initial gas limit. Can reach zero.
gas_left: Gas,
@@ -92,7 +92,7 @@ pub struct GasMeter<T: Trait> {
#[cfg(test)]
tokens: Vec<ErasedToken>,
}
impl<T: Trait> GasMeter<T> {
impl<T: Config> GasMeter<T> {
pub fn new(gas_limit: Gas) -> Self {
GasMeter {
gas_limit,