Skip to content
Snippets Groups Projects
Commit 825a454d authored by Cédric Moreau's avatar Cédric Moreau
Browse files

chore(#195): remove DUNITER_GENESIS_EXPORT

parent da5c438f
No related branches found
No related tags found
No related merge requests found
......@@ -661,70 +661,6 @@ where
panic!();
}
// Indexer output
if let Ok(path) = std::env::var("DUNITER_GENESIS_EXPORT") {
// genesis_certs_min_received => min_cert
// genesis_memberships_expire_on => membership_period
// genesis_smith_certs_min_received => smith_min_cert
let export = GenesisIndexerExport {
first_ud,
first_ud_reeval,
genesis_parameters: common_parameters.clone(),
identities: identities_v2,
sudo_key: sudo_key.clone(),
technical_committee,
ud,
wallets: accounts
.iter()
.map(|(account_id, data)| (account_id.clone(), data.balance))
.collect(),
smiths: (smiths)
.iter()
.map(|smith| {
(
smith.name.clone(),
SmithData {
idty_index: smith.idty_index,
name: smith.name.clone(),
account: smith.account.clone(),
session_keys: smith.session_keys.clone(),
certs_received: smith.certs_received.clone(),
},
)
})
.collect::<BTreeMap<String, SmithData>>(),
transactions_history: genesis_data.transactions_history.map(|history| {
history
.iter()
// Avoid wrong pubkeys in tx history
.filter(|(pubkey, _)| v1_pubkey_to_account_id((*pubkey).clone()).is_ok())
.map(|(pubkey, txs)| {
(
v1_pubkey_to_account_id(pubkey.clone())
.expect("already checked account"),
txs.iter()
// Avoid wrong pubkeys in tx history
.filter(|tx| v1_pubkey_to_account_id(tx.issuer.clone()).is_ok())
.map(|tx| TransactionV2 {
issuer: v1_pubkey_to_account_id(tx.issuer.clone())
.expect("already checked tx.issuer"),
amount: tx.amount.clone(),
written_time: tx.written_time,
comment: tx.comment.clone(),
})
.collect::<Vec<TransactionV2>>(),
)
})
.collect::<BTreeMap<AccountId, Vec<TransactionV2>>>()
}),
};
fs::write(
&path,
serde_json::to_string_pretty(&export).expect("should be serializable"),
)
.unwrap_or_else(|_| panic!("Could not export genesis data to {}", &path));
}
let genesis_data = GenesisData {
accounts,
treasury_balance,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment