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
@@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use crate::{Trait, Module};
use crate::{Config, Module};
use codec::{Encode, Decode};
use sp_runtime::{
traits::SignedExtension,
@@ -24,9 +24,9 @@ use sp_runtime::{
/// Ensure the runtime version registered in the transaction is the same as at present.
#[derive(Encode, Decode, Clone, Eq, PartialEq)]
pub struct CheckSpecVersion<T: Trait + Send + Sync>(sp_std::marker::PhantomData<T>);
pub struct CheckSpecVersion<T: Config + Send + Sync>(sp_std::marker::PhantomData<T>);
impl<T: Trait + Send + Sync> sp_std::fmt::Debug for CheckSpecVersion<T> {
impl<T: Config + Send + Sync> sp_std::fmt::Debug for CheckSpecVersion<T> {
#[cfg(feature = "std")]
fn fmt(&self, f: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result {
write!(f, "CheckSpecVersion")
@@ -38,16 +38,16 @@ impl<T: Trait + Send + Sync> sp_std::fmt::Debug for CheckSpecVersion<T> {
}
}
impl<T: Trait + Send + Sync> CheckSpecVersion<T> {
impl<T: Config + Send + Sync> CheckSpecVersion<T> {
/// Create new `SignedExtension` to check runtime version.
pub fn new() -> Self {
Self(sp_std::marker::PhantomData)
}
}
impl<T: Trait + Send + Sync> SignedExtension for CheckSpecVersion<T> {
impl<T: Config + Send + Sync> SignedExtension for CheckSpecVersion<T> {
type AccountId = T::AccountId;
type Call = <T as Trait>::Call;
type Call = <T as Config>::Call;
type AdditionalSigned = u32;
type Pre = ();
const IDENTIFIER: &'static str = "CheckSpecVersion";