diff --git a/node/src/chain_spec/gdev.rs b/node/src/chain_spec/gdev.rs index a66be70d21a9446bfd6833e250dab394db805260..910f593c9f39138836680a1b01302241eb82230c 100644 --- a/node/src/chain_spec/gdev.rs +++ b/node/src/chain_spec/gdev.rs @@ -336,7 +336,6 @@ fn genesis_data_to_gdev_genesis_conf( idty_index, name, owner_key, - old_owner_key, active, }| GenesisIdty { index: idty_index, @@ -344,7 +343,7 @@ fn genesis_data_to_gdev_genesis_conf( value: common_runtime::IdtyValue { data: IdtyData::new(), next_creatable_identity_on: 0, - old_owner_key: old_owner_key.map(|address| (address, 0)), + old_owner_key: None, owner_key, next_scheduled: if active { 0 } else { 2 }, status: IdtyStatus::Member, diff --git a/node/src/chain_spec/gen_genesis_data.rs b/node/src/chain_spec/gen_genesis_data.rs index 2565f3d4a273fdb7999e5be179372fdfc0ac18d4..ce8484d259900da94b846ead3d2e8616bf3f19ee 100644 --- a/node/src/chain_spec/gen_genesis_data.rs +++ b/node/src/chain_spec/gen_genesis_data.rs @@ -92,7 +92,6 @@ pub struct GenesisIdentity { pub idty_index: u32, pub name: String, pub owner_key: AccountId, - pub old_owner_key: Option<AccountId>, pub active: bool, } @@ -193,8 +192,6 @@ struct IdentityV2 { index: u32, /// ss58 address in gx network owner_key: AccountId, - /// optional ss58 address in the Äž1v1 - old_owner_key: Option<AccountId>, /// block at which the membership is set to expire (0 for expired members) membership_expire_on: u32, /// block at which the next cert can be emitted @@ -210,8 +207,6 @@ struct RawSmith { name: String, /// optional pre-set session keys (at least for the smith bootstraping the blockchain) session_keys: Option<String>, - /// optional pre-set account migration - migration_address: Option<AccountId>, #[serde(default)] certs_received: Vec<String>, } @@ -230,7 +225,6 @@ struct SmithData { #[derive(Clone, Deserialize, Serialize)] struct CliqueSmith { name: String, - migration_address: Option<AccountId>, session_keys: Option<String>, } @@ -301,7 +295,7 @@ where &common_parameters, ); let mut identities_v2: HashMap<String, IdentityV2> = - genesis_data_to_identities_v2(genesis_data.identities, genesis_timestamp, &smiths); + genesis_data_to_identities_v2(genesis_data.identities, genesis_timestamp); check_identities_v2(&identities_v2, &common_parameters); // MONEY AND WOT // @@ -1250,18 +1244,7 @@ fn check_genesis_data_and_filter_expired_certs_since_export( fn genesis_data_to_identities_v2( genesis_identities: BTreeMap<String, IdentityV1>, genesis_timestamp: u64, - smiths: &[RawSmith], ) -> HashMap<String, IdentityV2> { - let key_migrations: HashMap<String, AccountId> = smiths - .iter() - .filter(|s| s.migration_address.is_some()) - .map(|s| { - ( - s.name.clone(), - s.migration_address.clone().expect("already filtered"), - ) - }) - .collect(); genesis_identities .into_iter() .map(|(name, i)| { @@ -1276,23 +1259,12 @@ fn genesis_data_to_identities_v2( panic!("neither pubkey nor address is defined for {}", name) }) }); - let migration = key_migrations.get(name.as_str()); - let owner_key = if let Some(migrated_account) = migration { - migrated_account.clone() - } else { - legacy_account.clone() - }; - let old_owner_key = if migration.is_none() { - None - } else { - Some(legacy_account) - }; + let owner_key = legacy_account.clone(); ( name, IdentityV2 { index: i.index, owner_key, - old_owner_key, membership_expire_on: timestamp_to_relative_blocs( i.membership_expire_on, genesis_timestamp, @@ -1338,7 +1310,6 @@ fn make_authority_exist<SessionKeys: Encode, SKP: SessionKeysProvider<SessionKey balance: common_parameters.balances_existential_deposit, certs_received: HashMap::new(), membership_expire_on: common_parameters.membership_membership_period, - old_owner_key: None, next_cert_issuable_on: 0, }, ); @@ -1371,12 +1342,10 @@ fn make_authority_exist<SessionKeys: Encode, SKP: SessionKeysProvider<SessionKey // Add forced authority to smiths (whether explicit smith WoT or clique) if let Some(smith) = smiths.iter_mut().find(|s| &s.name == authority_name) { smith.session_keys = Some(forced_authority_session_keys); - smith.migration_address = None; } else { smiths.push(RawSmith { name: authority_name.clone(), session_keys: Some(forced_authority_session_keys), - migration_address: None, certs_received: vec![], }) } @@ -1463,7 +1432,6 @@ fn feed_identities( idty_index: identity.index, name: name.to_owned().clone(), owner_key: identity.owner_key.clone(), - old_owner_key: identity.old_owner_key.clone(), // but expired identities will just have their pseudonym reserved in the storage active: !expired, }); @@ -1626,7 +1594,6 @@ fn build_smiths_wot( name: smith.name.clone(), session_keys: smith.session_keys.clone(), certs_received: vec![], - migration_address: smith.migration_address.clone(), }) .collect::<Vec<RawSmith>>() } else { @@ -1715,7 +1682,6 @@ where idty_index: i as u32 + idty_index_start, name: String::from_utf8(name.0.clone()).unwrap(), owner_key: owner_key.clone(), - old_owner_key: None, active: true, }) .collect(); diff --git a/node/src/chain_spec/gtest.rs b/node/src/chain_spec/gtest.rs index e7814f6d0fb4e1e72f37e4610601ec5441e700da..e910008f27e1e05c0b0dd65be0067f29b0712119 100644 --- a/node/src/chain_spec/gtest.rs +++ b/node/src/chain_spec/gtest.rs @@ -284,7 +284,6 @@ fn genesis_data_to_gtest_genesis_conf( idty_index, name, owner_key, - old_owner_key, active, }| GenesisIdty { index: idty_index, @@ -292,7 +291,7 @@ fn genesis_data_to_gtest_genesis_conf( value: common_runtime::IdtyValue { data: IdtyData::new(), next_creatable_identity_on: 0, - old_owner_key: old_owner_key.clone().map(|address| (address, 0)), + old_owner_key: None, owner_key, next_scheduled: if active { 0 } else { 2 }, status: IdtyStatus::Member, diff --git a/resources/gdev.yaml b/resources/gdev.yaml index fcfd98034cb67c96d53cdc9991f43184fdffd02d..a2d5008b41e15db8384fedbd0ab2c700490514cb 100644 --- a/resources/gdev.yaml +++ b/resources/gdev.yaml @@ -59,13 +59,11 @@ clique_smiths: - name: "cgeek" # This smith will be the first author session_keys: "0xec6d7141864ca265b1c31a164d258e907e044380ac110c57502135943904137f5a172f9a6759763f59a7e0a4d170b467b744eabb3adb454f38a2e7957fb9cd285a172f9a6759763f59a7e0a4d170b467b744eabb3adb454f38a2e7957fb9cd285a172f9a6759763f59a7e0a4d170b467b744eabb3adb454f38a2e7957fb9cd28" - # This smith changes its key to Sr25519 wallet on startup (to be able to use Polkadot.js app right on start) - migration_address: "5E6q47RRGZU15LjUiBTm2DZjpqFKAjRNafYS8YV8AzTQZtLG" sudo_key: "5CfodrEFe64MJtWvfhTHYBuUySr4WXLv2B41mZFucTXSGMFA" # The address which will automatically transfer 1,00 ÄžD on Genesis to the Treasury -treasury_funder_address: "5E6q47RRGZU15LjUiBTm2DZjpqFKAjRNafYS8YV8AzTQZtLG" +treasury_funder_pubkey: "2ny7YAdmzReQxAayyJZsyVYwYhVyax2thKcGknmQy5nQ" # The technical committee members, to act as sudo technical_committee: diff --git a/resources/gtest.yaml b/resources/gtest.yaml index 06e66eace5863c5e6e34706a7464c58fe17f9df8..c580bc06f86682e24ea55970d48e75826b6694c2 100644 --- a/resources/gtest.yaml +++ b/resources/gtest.yaml @@ -18,14 +18,12 @@ clique_smiths: - name: "cgeek" # This smith will be the first author session_keys: "0xec6d7141864ca265b1c31a164d258e907e044380ac110c57502135943904137f5a172f9a6759763f59a7e0a4d170b467b744eabb3adb454f38a2e7957fb9cd285a172f9a6759763f59a7e0a4d170b467b744eabb3adb454f38a2e7957fb9cd285a172f9a6759763f59a7e0a4d170b467b744eabb3adb454f38a2e7957fb9cd28" - # This smith changes its key to Sr25519 wallet on startup (to be able to use Polkadot.js app right on start) - migration_address: "5E6q47RRGZU15LjUiBTm2DZjpqFKAjRNafYS8YV8AzTQZtLG" # FIXME sudo_key: "5Hm8sBbwuLAU99dBezvgtnRmZCrUy9mhqmbQMFyGTaeATYg7" # The address which will automatically transfer 1,00 ÄžD on Genesis to the Treasury -treasury_funder_address: "5E6q47RRGZU15LjUiBTm2DZjpqFKAjRNafYS8YV8AzTQZtLG" +treasury_funder_pubkey: "2ny7YAdmzReQxAayyJZsyVYwYhVyax2thKcGknmQy5nQ" # The technical committee members, to act as sudo technical_committee: ["Pini", "moul", "HugoTrentesaux", "tuxmain", "1000i100", "vit", "cgeek"] \ No newline at end of file