Skip to content

Commit

Permalink
fix \r trim in operators csv
Browse files Browse the repository at this point in the history
  • Loading branch information
vadiminc committed Aug 6, 2023
1 parent 801dfe7 commit 1e3690d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ssv-keys",
"version": "1.0.7",
"version": "1.0.8",
"description": "Tool for splitting a validator key into a predefined threshold of shares via Shamir-Secret-Sharing (SSS), and encrypt them with a set of operator keys.",
"author": "SSV.Network",
"repository": "https://github.com/bloxapp/ssv-keys",
Expand Down
8 changes: 1 addition & 7 deletions src/commands/actions/KeySharesCustomBulkAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@ export class KeySharesCustomBulkAction extends BaseAction {
} = this.args;

// Now save to key shares file encrypted shares and validator public key
/*
const operators = operatorKeys.map((operatorKey: string, index: number) => ({
id: operatorIds[index],
operatorKey,
}));
*/
const operators = readOperatorsFile(sanitizePath(operatorsFile));
const operatorsDistribution = readOperatorsDistributionFile(sanitizePath(operatorsDistributionFile));

Expand All @@ -75,7 +69,7 @@ export class KeySharesCustomBulkAction extends BaseAction {

// validate data
if (files.length !== operatorGroups.length) {
throw Error(`Files amoumt(${files.length}) is not equal clusters amount(${operatorGroups.length})`);
throw Error(`Files amount(${files.length}) is not equal clusters amount(${operatorGroups.length})`);
}

// validate all files
Expand Down
2 changes: 1 addition & 1 deletion src/lib/helpers/file.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const readOperatorsFile = (filePath: string): Map<number, string> => {
const operators = new Map<number, string>();
lines.forEach(line => {
const [id, operatorKey] = line.split(',');
operators.set(Number(id), operatorKey);
operators.set(Number(id), operatorKey.replace(/(\r\n|\n|\r)/gm, ''));
});
return operators;
}
Expand Down

0 comments on commit 1e3690d

Please sign in to comment.