Skip to content
Snippets Groups Projects
Select Git revision
  • 2aae3023cd6accb4ec6cdeb4339884b6deafb863
  • master default protected
  • set_UniversalDividendApi_in_RuntimeApiCollection
  • tuxmain/fix-change-owner-key
  • network/gtest-1000 protected
  • upgradable-multisig
  • runtime/gtest-1000
  • network/gdev-800 protected
  • cgeek/issue-297-cpu
  • gdev-800-tests
  • update-docker-compose-rpc-squid-names
  • fix-252
  • 1000i100-test
  • hugo/tmp-0.9.1
  • network/gdev-803 protected
  • hugo/endpoint-gossip
  • network/gdev-802 protected
  • hugo/distance-precompute
  • network/gdev-900 protected
  • tuxmain/anonymous-tx
  • debug/podman
  • gtest-1000-0.11.1 protected
  • gtest-1000-0.11.0 protected
  • gtest-1000 protected
  • gdev-900-0.10.1 protected
  • gdev-900-0.10.0 protected
  • gdev-900-0.9.2 protected
  • gdev-800-0.8.0 protected
  • gdev-900-0.9.1 protected
  • gdev-900-0.9.0 protected
  • gdev-803 protected
  • gdev-802 protected
  • runtime-801 protected
  • gdev-800 protected
  • runtime-800-bis protected
  • runtime-800 protected
  • runtime-800-backup protected
  • runtime-701 protected
  • runtime-700 protected
  • runtime-600 protected
  • runtime-500 protected
41 results

lib.rs

Blame
  • lib.rs 2.96 KiB
    // Copyright 2021 Axiom-Team
    //
    // This file is part of Duniter-v2S.
    //
    // Duniter-v2S is free software: you can redistribute it and/or modify
    // it under the terms of the GNU Affero General Public License as published by
    // the Free Software Foundation, version 3 of the License.
    //
    // Duniter-v2S is distributed in the hope that it will be useful,
    // but WITHOUT ANY WARRANTY; without even the implied warranty of
    // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    // GNU Affero General Public License for more details.
    //
    // You should have received a copy of the GNU Affero General Public License
    // along with Duniter-v2S. If not, see <https://www.gnu.org/licenses/>.
    
    #![cfg_attr(not(feature = "std"), no_std)]
    
    mod apis;
    pub mod constants;
    pub mod entities;
    pub mod fees;
    pub mod handlers;
    mod pallets_config;
    pub mod providers;
    pub mod weights;
    
    pub use pallet_duniter_account::GenesisAccountData;
    pub use pallet_identity::{GenesisIdty, IdtyName, IdtyStatus, IdtyValue};
    pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic;
    
    /// Some way of identifying an account on the chain. We intentionally make it equivalent
    /// to the public key of our transaction signing scheme.
    pub type AccountId = <<Signature as sp_runtime::traits::Verify>::Signer as sp_runtime::traits::IdentifyAccount>::AccountId;
    
    /// The address format for describing accounts.
    pub type Address = sp_runtime::MultiAddress<AccountId, ()>;
    
    /// Balance of an account.
    pub type Balance = u64;
    
    /// Block type.
    pub type Block = sp_runtime::generic::Block<Header, UncheckedExtrinsic>;
    
    /// Block identifier type.
    pub type BlockId = sp_runtime::generic::BlockId<Block>;
    
    /// An index to a block.
    pub type BlockNumber = u32;
    
    /// A hash of some data used by the chain.
    pub type Hash = sp_core::H256;
    
    /// Block header type
    pub type Header = sp_runtime::generic::Header<BlockNumber, sp_runtime::traits::BlakeTwo256>;
    
    /// Index of a transaction in the chain.
    pub type Index = u32;
    
    /// Alias to 512-bit hash when used in the context of a transaction signature on the chain.
    pub type Signature = sp_runtime::MultiSignature;
    
    /// Index of an identity
    pub type IdtyIndex = u32;
    
    /// Time in milliseconds
    pub type Moment = u64;
    
    pub struct FullIdentificationOfImpl;
    impl sp_runtime::traits::Convert<AccountId, Option<entities::ValidatorFullIdentification>>
        for FullIdentificationOfImpl
    {
        fn convert(_: AccountId) -> Option<entities::ValidatorFullIdentification> {
            Some(entities::ValidatorFullIdentification)
        }
    }
    
    pub struct GetCurrentEpochIndex<Runtime>(core::marker::PhantomData<Runtime>);
    impl<Runtime: pallet_babe::Config> frame_support::pallet_prelude::Get<u64>
        for GetCurrentEpochIndex<Runtime>
    {
        fn get() -> u64 {
            pallet_babe::Pallet::<Runtime>::epoch_index()
        }
    }
    
    pub struct IdtyNameValidatorImpl;
    impl pallet_identity::traits::IdtyNameValidator for IdtyNameValidatorImpl {
        fn validate(idty_name: &pallet_identity::IdtyName) -> bool {
            duniter_primitives::validate_idty_name(&idty_name.0)
        }
    }