Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
50adc45
style: use new code style
martiliones Feb 15, 2022
b278e79
Update author
martiliones Feb 15, 2022
c4be7b1
docs(contributing): remove extra point
martiliones Feb 15, 2022
73e4b68
docs: add rule for the PR guidelines
martiliones Feb 15, 2022
16aec38
Merge branch dev
martiliones Mar 25, 2022
d518ae6
refactor: move the code to src directory
martiliones Mar 25, 2022
bdf5f0b
refactor: convert tabs to spaces
martiliones Mar 25, 2022
b707075
refactor(index.js): fix ESLint errors and more
martiliones Mar 25, 2022
6f32cb7
refactor: autofix ESLint errors
martiliones Mar 25, 2022
9255312
refactor(validator): fix ESLint errors and simplify
martiliones Mar 25, 2022
186e80d
refactor(transactionFormer): fix ESLint errors and make code cleaner
martiliones Mar 26, 2022
0a07765
refactor(healthCheck): fix ESLint errors
martiliones Mar 26, 2022
094ff33
refactor(groups, helpers): fix ESLint errors, JSDoc and request retries
martiliones Mar 26, 2022
b7ae81d
refactor(groups, helpers): fix ESLint errors, JSDoc
martiliones Mar 26, 2022
7edf889
fix(sendMessage): fix `message_type` name property
martiliones Mar 26, 2022
8a84272
refactor(sendMessage): simpify and remove useless code
martiliones Mar 26, 2022
629b92e
fix(healthCheck): variables activeNode and isCheckingNodes do not update
martiliones Mar 26, 2022
b812fea
test: add jest as dev dependency
martiliones Mar 27, 2022
f02b1d5
test: write tests for the validator
martiliones Mar 27, 2022
2717799
refactor: time module
martiliones Mar 30, 2022
2b33cde
fix: chatGetBytes and minor changes
martiliones Mar 31, 2022
58b20fd
style: remove the new lines and change logger property name
martiliones Mar 31, 2022
96002b0
refactor(keys): rewrite the code to ES6+ and simplify code
martiliones Mar 31, 2022
0d7cca7
refactor(healthCheck): rewrite the code to ES6+ and move constant to …
martiliones Mar 31, 2022
19fdba8
refactor(encryptor): use string instead of array
martiliones Mar 31, 2022
360d8dd
test: write tests for keys module
martiliones Mar 31, 2022
4c04713
test: write tests for logger module
martiliones Mar 31, 2022
6672ba4
test: write unit tests for getting epoch time
martiliones Mar 31, 2022
02487cb
test: write unit tests for creating transactions
martiliones Mar 31, 2022
ecbe0b0
refactor(decodeMsg): rewrite the code to ES6+
martiliones Mar 31, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions .editorconfig

This file was deleted.

70 changes: 28 additions & 42 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,29 @@
module.exports = {
"parserOptions": {
"ecmaVersion": 8,
"sourceType": "module"
},
"rules": {
"semi": "warn", // обязательно ;
"semi-spacing": ["error", {"before": false, "after": true}],
"indent": ["error", "tab"],
"space-infix-ops": "error",// отступы вокруг + - * / = и тд
"eqeqeq": "error", // обязательно === и !== (нельзя == и !=)
// "no-eq-null": "error", // обязательно === и !== (нельзя == и !=) но тоько в отношении null
"curly": "error", // проверка шаблонов `${name}`
// "space-before-function-paren": [ // отступ до и после function
// "error", {
// "anonymous": "always",
// "named": "always",
// "asyncArrow": "ignore"
// }
// ],
"key-spacing": ["error", { "mode": "strict" }], // оформление обЪекта
"space-in-parens": ["error", "never"], // запрет отступов ( a,b)
"computed-property-spacing": ["error", "never"], // запрет лишних отступов в выражениях a[ i]
"array-bracket-spacing": ["error", "never"],
"no-multi-spaces": "error", // запрет лишних пробелов var a = 2
"no-sparse-arrays": "warn", // предупреждение при дырке в массиве
"no-mixed-spaces-and-tabs": "error", // нельзя миксовать табы и пробелы
"keyword-spacing": ["error", { "after": true }],
"comma-spacing": ["error", { "before": false, "after": true }], // отступ после запятой, а перед нельзя
"no-undef":"error",
"array-callback-return": "error" // коллбек методов массива типа arr.map arr.filter должны иметь return в коллбеке
},
"env": {
"browser": true,
"node": true
},
"globals": {
"Vue":true,
"Symbol":true,
"Promise":true,
},
"plugins": []
}
env: {
commonjs: true,
es2021: true,
browser: true,
node: true,
'jest/globals': true,
},
extends: ['eslint:recommended', 'google'],
plugins: ['jest'],
parserOptions: {
ecmaVersion: 12,
},
rules: {
'max-len': [
'error',
{
code: 200,
ignoreTrailingComments: true,
ignoreUrls: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: true,
},
],
'require-jsdoc': 'off',
'quote-props': 'off',
},
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ logs/
.vscode/
test.js
package-lock.json
.editorconfig
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no -- commitlint --edit
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run lint
91 changes: 91 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Contributing Guide

Before submitting your contribution, please make sure to take a moment and read through the following guidelines:

- [Pull Request Guidelines](#pull-request-guidelines)
- [Development Setup](#development-setup)
- [Scripts](#scripts)
- [Project Structure](#project-structure)
- [Contributing Tests](#contributing-tests)

## Pull Request Guidelines

- The master branch is just a snapshot of the latest stable release. All development should be done in dedicated branches. Do not submit PRs against the master branch.

- Checkout a topic branch from a base branch, e.g. `master`, and merge back against that branch.

- If adding a new feature add accompanying test case.

- It's OK to have multiple small commits as you work on the PR - GitHub can automatically squash them before merging.

- Make sure tests pass!

- Commit messages must follow the [commit message convention](./commit-convention.md). Commit messages are automatically validated before commit (by invoking [Git Hooks](https://git-scm.com/docs/githooks) via [husky](https://github.com/typicode/husky)).

- No need to worry about code style as long as you have installed the dev dependencies - modified files are automatically formatted with Prettier on commit (by invoking [Git Hooks](https://git-scm.com/docs/githooks) via [husky](https://github.com/typicode/husky)).

## Development Setup

You will need [Node.js](https://nodejs.org) **version 16+**.

After cloning the repo, run:

```bash
$ npm i # install the dependencies of the project
```

A high level overview of tools used:

- [Jest](https://jestjs.io/) for unit testing
- [Prettier](https://prettier.io/) for code formatting

## Scripts

### `npm run lint`

The `lint` script runs linter.

```bash
# lint files
$ npm run lint
# fix linter errors
$ npm run lint:fix
```

### `npm run test`

The `test` script simply calls the `jest` binary, so all [Jest CLI Options](https://jestjs.io/docs/en/cli) can be used. Some examples:

```bash
# run all tests
$ npm run test

# run all tests under the runtime-core package
$ npm run test -- runtime-core

# run tests in a specific file
$ npm run test -- fileName

# run a specific test in a specific file
$ npm run test -- fileName -t 'test name'
```

## Project Structure

- **`src`**: contains the source code

- **`api`**: contains group of methods and methods for the API.

- **`helpers`**: contains utilities shared across the entire codebase.

- **`tests`**: contains tests for the helpers directory.

- **`tests`**: contains tests for the src directory.

## Contributing Tests

Unit tests are collocated with the code being tested inside directories named `tests`. Consult the [Jest docs](https://jestjs.io/docs/en/using-matchers) and existing test cases for how to write new test specs. Here are some additional guidelines:

- Use the minimal API needed for a test case. For example, if a test can be written without involving the reactivity system or a component, it should be written so. This limits the test's exposure to changes in unrelated parts and makes it more stable.

- Only use platform-specific runtimes if the test is asserting platform-specific behavior.
3 changes: 3 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional']
};
83 changes: 0 additions & 83 deletions groups/decodeMsg.js

This file was deleted.

24 changes: 0 additions & 24 deletions groups/eth.js

This file was deleted.

46 changes: 0 additions & 46 deletions groups/get.js

This file was deleted.

Loading