Commit bf481be0 authored by Hugo Trentesaux's avatar Hugo Trentesaux
Browse files

Consts

parent 0d281886
use crate::{blockchain, state};
use crate::{blockchain, consts, state};
use dup_crypto::keys::{ed25519::PublicKey as Pubkey, PublicKey};
use indicatif::ProgressBar;
......@@ -64,18 +64,14 @@ impl blockchain::BcReader<Config> for BcDup {
impl BcDup {
pub fn new() -> Self {
let bar = ProgressBar::new(
std::fs::read_dir("/home/tuxmain/.config/duniter/duniter_default/g1")
.unwrap()
.count() as u64,
);
let bar = ProgressBar::new(std::fs::read_dir(consts::G1_PATH).unwrap().count() as u64);
let mut blocks = Vec::new();
for i in 0usize.. {
match std::fs::File::open(format!(
"/home/tuxmain/.config/duniter/duniter_default/g1/chunk_{}-250.json",
i
)) {
let mut path = String::from(consts::G1_PATH);
path.push_str(&format!("/chunk_{}-250.json", i));
match std::fs::File::open(path) {
Ok(chunk) => {
if let Ok(chunk) = simd_json::from_reader::<_, serde_json::Value>(chunk) {
for block in chunk["blocks"].as_array().unwrap() {
......
pub const G1_PATH: &str = "/home/tuxmain/.config/duniter/duniter_default/g1";
// pub const G1_PATH: &str = "/home/hugo/Téléchargements/TMP_g1/chunks";
mod bc_dup;
mod bc_mock;
mod blockchain;
mod consts;
mod state;
use crate::blockchain::BcReader;
......@@ -146,7 +147,7 @@ impl<C: 'static + Debug + blockchain::Config, R: 'static + BcReader<C>> Gexplore
.add_plugin(PolylinePlugin)
.add_plugin(EguiPlugin)
.add_plugin(bevy_atmosphere::AtmospherePlugin {
dynamic: false, // Set to false since we aren't changing the sky's appearance
dynamic: false, // Set to false since we aren't changing the sky's appearance
sky_radius: 10000.0,
})
.add_system(Self::keyboard_event_system)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment