From 01d122b1e0a0c28cb05de64e03e4ef028316d2f4 Mon Sep 17 00:00:00 2001 From: Sameer Kumar Subudhi Date: Thu, 19 Oct 2023 20:55:12 +0200 Subject: [PATCH] :hammer: Refactor code --- .eslintrc.js | 4 ++- docs/migration.md | 11 +++---- src/constants.ts | 16 +++++++--- src/events.ts | 4 +-- src/index.ts | 51 +++++++++++++++----------------- src/utils/commands.ts | 17 +++++++---- src/utils/exception.ts | 6 ++-- src/utils/genesis_block.ts | 8 ++--- src/utils/node.ts | 42 ++++++++++++++++++-------- test/unit/utils/commands.spec.ts | 7 ++--- 10 files changed, 99 insertions(+), 67 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index e8db1793..932e36af 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -16,8 +16,9 @@ module.exports = { rules: { 'max-len': 'off', // Managed by prettier 'no-underscore-dangle': 'off', // Used for private variables and methods - 'implicit-arrow-linebreak': 'off', // Prefered + 'implicit-arrow-linebreak': 'off', // Preferred 'no-mixed-spaces-and-tabs': 'off', // Managed by prettier + 'no-shadow': 'off', 'operator-linebreak': 'off', 'import/prefer-default-export': 'off', 'lines-between-class-members': 'off', // Off because typescript has members and methods @@ -31,6 +32,7 @@ module.exports = { '@typescript-eslint/no-unnecessary-boolean-literal-compare': ['error'], '@typescript-eslint/no-unnecessary-qualifier': ['error'], '@typescript-eslint/no-unnecessary-type-arguments': ['error'], + '@typescript-eslint/no-shadow': 'warn', '@typescript-eslint/prefer-for-of': ['error'], '@typescript-eslint/prefer-function-type': ['error'], '@typescript-eslint/prefer-includes': ['error'], diff --git a/docs/migration.md b/docs/migration.md index 5d40f5e1..969c0bc9 100644 --- a/docs/migration.md +++ b/docs/migration.md @@ -1,11 +1,12 @@ # Migration Guide -This section explains how to migrate a Lisk Core v3.0.4 (or later) node to Lisk Core v4.x using the Lisk Migrator. +This section explains how to migrate a Lisk Core v3.1.0 node to Lisk Core v4.0.0 using the Lisk Migrator. -The Lisk Migrator CLI tool will generate a new genesis (snapshot) block for Lisk Core v4.x. -The new genesis block is created based on a snapshot of the existing blockchain (running on Lisk Core v3.0.4+) at a pre-determined height. +The Lisk Migrator CLI tool will generate a new genesis (snapshot) block for Lisk Core v4.0.0. +The new genesis block is created based on a snapshot of the existing blockchain (running on Lisk Core v3.1.0) at a pre-determined height. -Lisk Migrator automatically exports the node's Forging Status information to the file named `forgingStatus.json` under the output directory. In case, Lisk Migrator is unable to save to the disk, as a fallback, the Forging Status information is logged to the standard output. +Lisk Migrator automatically exports the node's Forging Status information to the file named `forgingStatus.json` under the output directory. +In case, the Lisk Migrator is unable to save to the disk, as a fallback, the Forging Status information is logged to the standard output.