Skip to content

Commit

Permalink
fix: NPG-2188 fix file lister paths (they still contains a part of ro…
Browse files Browse the repository at this point in the history
…ot path)
  • Loading branch information
dkijania committed Jul 19, 2022
1 parent de433f0 commit a259498
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 11 deletions.
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions integration-tests/src/common/mainnet.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use catalyst_toolbox::snapshot::registration::{Delegations, VotingRegistration};
use catalyst_toolbox::snapshot::CatalystRegistration;
use chain_addr::Discrimination;
use jormungandr_lib::crypto::account::SigningKey;
use vitup::config::Block0Initial;
Expand Down Expand Up @@ -39,13 +39,12 @@ impl MainnetWallet {
self.inner.secret_key()
}

pub fn as_voting_registration(&self) -> VotingRegistration {
VotingRegistration {
pub fn as_voting_registration(&self) -> CatalystRegistration {
CatalystRegistration {
stake_public_key: self.stake_public_key(),
voting_power: self.stake.into(),
reward_address: self.reward_address(),
delegations: Delegations::Legacy(self.inner.identifier().into()),
voting_purpose: 0,
voting_public_key: self.inner.identifier().into(),
}
}

Expand Down
1 change: 1 addition & 0 deletions vitup/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ voting-hir = { git = "https://github.com/input-output-hk/catalyst-toolbox.git",
valgrind = { path = "../valgrind" }
poldercast = { git = "https://github.com/primetype/poldercast.git", rev = "8305f1560392a9d26673ca996e7646c8834533ef" }
rand = "0.8"
path-slash = "0.2.0"
netstat2 = "0.9"
time = { version = "0.3.7", features=["serde","serde-well-known","parsing"]}
fake = { version = "2.2", features=['chrono','http']}
Expand Down
7 changes: 7 additions & 0 deletions vitup/resources/example/challenges.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"description": "What Challenges should the community prioritize to address in Fund6?",
"fund_id": "4",
"id": "1",
"internal_id": 1,
"proposers_rewards": "0",
"rewards_total": "400000",
"title": "Fund6 Challenge Setting"
Expand All @@ -15,6 +16,7 @@
"description": "How can application developers drive adoption of Cardano in 2021?",
"fund_id": "4",
"id": "2",
"internal_id": 2,
"proposers_rewards": "200000",
"rewards_total": "200000",
"title": "Dapps & Integrations"
Expand All @@ -25,6 +27,7 @@
"description": "How can we create a positive developer experience that helps the developer focus on building successful apps?",
"fund_id": "4",
"id": "3",
"internal_id": 3,
"proposers_rewards": "400000",
"rewards_total": "400000",
"title": "Developer Ecosystem"
Expand All @@ -35,6 +38,7 @@
"description": "How can we help the Catalyst community to get better at distributed decision making within the next two Catalyst rounds?",
"fund_id": "4",
"id": "4",
"internal_id": 4,
"proposers_rewards": "50000",
"rewards_total": "50000",
"title": "Distributed Decision Making"
Expand All @@ -45,6 +49,7 @@
"description": "How can we encourage entrepreneurs from outside the Cardano ecosystem to submit proposals to Catalyst in the next two funds?",
"fund_id": "4",
"id": "5",
"internal_id": 5,
"proposers_rewards": "50000",
"rewards_total": "50000",
"title": "Proposer Outreach"
Expand All @@ -55,6 +60,7 @@
"description": "How can we encourage more meaningful participation in Project Catalyst from community members in the next two funds?",
"fund_id": "4",
"id": "6",
"internal_id": 6,
"proposers_rewards": "50000",
"rewards_total": "50000",
"title": "Catalyst Value Onboarding"
Expand All @@ -65,6 +71,7 @@
"description": "How can we mobilize the community to solve local problems using Cardano, through a Local Community Center model supported by the CF?",
"fund_id": "4",
"id": "7",
"internal_id": 7,
"proposers_rewards": "50000",
"rewards_total": "50000",
"title": "Local Community Centers"
Expand Down
12 changes: 6 additions & 6 deletions vitup/src/mode/service/manager/file_lister.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use path_slash::PathBufExt as _;
use path_slash::PathExt as _;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use std::path::Path;
Expand Down Expand Up @@ -65,11 +67,9 @@ impl FolderDump {
}

pub fn push_path<P: AsRef<Path>>(&mut self, input: P) {
let path = input.as_ref().display().to_string().replace("'\\'", "/");
let path = path.replace(
&format!("./{}/", self.root.file_name().unwrap().to_str().unwrap()),
"",
);
let path = input.as_ref().to_slash().unwrap();
let replacer = self.root.to_slash().unwrap();
let path = path.replace(&format!("{}/", replacer), "");

if path.contains(QR_CODES) {
self.push_qr_code(path);
Expand Down Expand Up @@ -111,7 +111,7 @@ pub fn dump_json<P: AsRef<Path>>(root: P) -> Result<FolderDump, Error> {
continue;
}

data.push_path(entry.path());
data.push_path(&*entry.path().to_slash().unwrap());
}

Ok(data)
Expand Down

0 comments on commit a259498

Please sign in to comment.