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