Select Git revision
pallet_conventions.md
-
Hugo Trentesaux authored
* delete notes.txt file * update notes with links to issues * update comment according to #159 * doc idtystatus in readme * update weightinfo and benchmarks accordingly * add benchmark * remove remove_identity_consumers * remove force_remove_identity call * fix todo in test * update doc - remove request_membership - remove validate_identity * fix tests according to new MembershipRemovalReason * add membership removal reasons and clean up membership internal functions * remove check_remove_identity * build live tests (but no current network to check them against) * clippy
* add wot tests related to issue #136 * refac certification creation checks * refac identity creation checks * test benchmark ok * more precise error messages * check benchmarks ok * cargo cucumber ok * cargo test workspace ok * cargo test workspace quasi ok * cargo check all tests * cargo check all * remove IdtyEvent change owner key * remove removal other reason * refac revocation and removal reason * wip * refac * refac scheduling (tests ok) * add *Period * cargo test identity ok * remove IdtyEvent::Validated * cargo test wot ok * cargo test wot ok (one fails but fot the good reason) * cargo test membership ok * cargo check wot tests * cargo check identity tests * cargo check membership tests * also remove validate trait * remove validate_identity * refac identity status to allow more fine-grain control * remove unused trait * cargo check ok * remove indentity confirmation constraints * remove request from membership primitives * remove request_membership from lib.rsHugo Trentesaux authored* delete notes.txt file * update notes with links to issues * update comment according to #159 * doc idtystatus in readme * update weightinfo and benchmarks accordingly * add benchmark * remove remove_identity_consumers * remove force_remove_identity call * fix todo in test * update doc - remove request_membership - remove validate_identity * fix tests according to new MembershipRemovalReason * add membership removal reasons and clean up membership internal functions * remove check_remove_identity * build live tests (but no current network to check them against) * clippy
* add wot tests related to issue #136 * refac certification creation checks * refac identity creation checks * test benchmark ok * more precise error messages * check benchmarks ok * cargo cucumber ok * cargo test workspace ok * cargo test workspace quasi ok * cargo check all tests * cargo check all * remove IdtyEvent change owner key * remove removal other reason * refac revocation and removal reason * wip * refac * refac scheduling (tests ok) * add *Period * cargo test identity ok * remove IdtyEvent::Validated * cargo test wot ok * cargo test wot ok (one fails but fot the good reason) * cargo test membership ok * cargo check wot tests * cargo check identity tests * cargo check membership tests * also remove validate trait * remove validate_identity * refac identity status to allow more fine-grain control * remove unused trait * cargo check ok * remove indentity confirmation constraints * remove request from membership primitives * remove request_membership from lib.rs
gtest.rs 12.49 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/>.
use super::*;
use crate::chain_spec::gen_genesis_data::{CommonParameters, GenesisIdentity, SessionKeysProvider};
use common_runtime::{constants::*, entities::IdtyData, GenesisIdty};
use gtest_runtime::{
opaque::SessionKeys, pallet_universal_dividend, parameters, ImOnlineId, Runtime, WASM_BINARY,
};
use jsonrpsee::core::JsonValue;
use sc_consensus_grandpa::AuthorityId as GrandpaId;
use sc_network::config::MultiaddrWithPeerId;
use sc_service::ChainType;
use sc_telemetry::TelemetryEndpoints;
use serde::Deserialize;
use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId;
use sp_consensus_babe::AuthorityId as BabeId;
use sp_core::{sr25519, Get};
use std::{env, fs};
pub type ChainSpec = sc_service::GenericChainSpec;
pub type AuthorityKeys = (
AccountId,
GrandpaId,
BabeId,
ImOnlineId,
AuthorityDiscoveryId,
);
const TOKEN_DECIMALS: usize = 2;
const TOKEN_SYMBOL: &str = "ĞT";
static EXISTENTIAL_DEPOSIT: u64 = parameters::ExistentialDeposit::get();
#[derive(Default, Clone, Deserialize)]
// No parameters for GTest (unlike GDev)
struct GenesisParameters {}
struct GTestSKP;
impl SessionKeysProvider<SessionKeys> for GTestSKP {
fn session_keys(keys: &AuthorityKeys) -> SessionKeys {
let cloned = keys.clone();
SessionKeys {
grandpa: cloned.1,
babe: cloned.2,
im_online: cloned.3,
authority_discovery: cloned.4,
}
}
}
/// generate local network chainspects
pub fn local_testnet_config(
initial_authorities_len: usize,
initial_smiths_len: usize,
initial_identities_len: usize,
) -> Result<ChainSpec, String> {
Ok(ChainSpec::builder(