Skip to content
Snippets Groups Projects
Commit b56b255c authored by Hugo Trentesaux's avatar Hugo Trentesaux
Browse files

get values of parameters

parent 77a4185f
Branches
Tags
1 merge request!168gtest genesis new format
This commit is part of merge request !171. Comments created here will be created in the context of that merge request.
...@@ -18,8 +18,8 @@ use common_runtime::constants::*; ...@@ -18,8 +18,8 @@ use common_runtime::constants::*;
use common_runtime::entities::IdtyData; use common_runtime::entities::IdtyData;
use common_runtime::*; use common_runtime::*;
use gtest_runtime::{ use gtest_runtime::{
opaque::SessionKeys, AccountConfig, AccountId, AuthorityMembersConfig, BabeConfig, CertConfig, opaque::SessionKeys, parameters, AccountConfig, AccountId, AuthorityMembersConfig, BabeConfig,
GenesisConfig, IdentityConfig, MembershipConfig, SessionConfig, SmithCertConfig, CertConfig, GenesisConfig, IdentityConfig, MembershipConfig, SessionConfig, SmithCertConfig,
SmithMembershipConfig, SudoConfig, SystemConfig, TechnicalCommitteeConfig, SmithMembershipConfig, SudoConfig, SystemConfig, TechnicalCommitteeConfig,
UniversalDividendConfig, UniversalDividendConfig,
}; };
...@@ -29,11 +29,12 @@ use std::collections::{BTreeMap, HashMap}; ...@@ -29,11 +29,12 @@ use std::collections::{BTreeMap, HashMap};
type MembershipData = sp_membership::MembershipData<u32>; type MembershipData = sp_membership::MembershipData<u32>;
const EXISTENTIAL_DEPOSIT: u64 = 200; // get values of parameters
const MIN_CERT: u32 = 5; static EXISTENTIAL_DEPOSIT: u64 = parameters::ExistentialDeposit::get();
const SMITH_MIN_CERT: u32 = 5; static SMITH_MEMBERSHIP_EXPIRE_ON: u32 = parameters::SmithMembershipPeriod::get();
const GENESIS_SMITH_MEMBERSHIP_EXPIRE_ON: u32 = 1000000000; static SMITH_CERTS_EXPIRE_ON: u32 = parameters::SmithCertPeriod::get();
const GENESIS_SMITH_CERTS_EXPIRE_ON: u32 = 1000000000; static MIN_CERT: u32 = parameters::WotMinCertForMembership::get();
static SMITH_MIN_CERT: u32 = parameters::SmithWotMinCertForMembership::get();
// define structure of json // define structure of json
#[derive(Clone, Deserialize)] #[derive(Clone, Deserialize)]
...@@ -361,7 +362,7 @@ pub fn build_genesis( ...@@ -361,7 +362,7 @@ pub fn build_genesis(
.get(issuer) .get(issuer)
.ok_or(format!("Identity '{}' does not exist", issuer))? .ok_or(format!("Identity '{}' does not exist", issuer))?
.index; .index;
certs.insert(*issuer_index, Some(GENESIS_SMITH_CERTS_EXPIRE_ON)); certs.insert(*issuer_index, Some(SMITH_CERTS_EXPIRE_ON));
counter_smith_cert += 1; counter_smith_cert += 1;
} }
smith_certs_by_receiver.insert(identity.index, certs); smith_certs_by_receiver.insert(identity.index, certs);
...@@ -370,7 +371,7 @@ pub fn build_genesis( ...@@ -370,7 +371,7 @@ pub fn build_genesis(
smith_memberships.insert( smith_memberships.insert(
identity.index, identity.index,
MembershipData { MembershipData {
expire_on: GENESIS_SMITH_MEMBERSHIP_EXPIRE_ON, expire_on: SMITH_MEMBERSHIP_EXPIRE_ON,
}, },
); );
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment