Skip to content

Commit

Permalink
chore(ethers): change to ethers and updgrade dependencies
Browse files Browse the repository at this point in the history
feat(upgrade): re-create project with hardhat & ethers
removing truffle and web3

chore: re-adds contracts

chore: adds dev rules

chore(contracts): fixes solidity lint errors

chore(test): re-adds tests

chore(upgrade): adds deployment tools

chore(upgrade): add smock for contract mocking

chore(upgrade): removes sol tests

chore(upgrade): fixe pre-commit and update readme

chore(upgrade): add more eslint rules

chore(deps): move typechain to deps

chore(upgrade): unignore dist from npm i

chore(ethers): return util token for manual testing 👿
  • Loading branch information
jurajpiar committed Sep 14, 2022
1 parent 90aa30b commit cde87f0
Show file tree
Hide file tree
Showing 111 changed files with 5,264 additions and 16,767 deletions.
49 changes: 49 additions & 0 deletions .commitlintrc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import type { UserConfig } from '@commitlint/types';

const Configuration: UserConfig = {
/*
* Resolve and load @commitlint/config-conventional from node_modules.
* Referenced packages must be installed
*/
extends: ['@commitlint/config-conventional'],
/*
* Resolve and load conventional-changelog-atom from node_modules.
* Referenced packages must be installed
*/
// parserPreset: 'conventional-changelog-atom',
/*
* Resolve and load @commitlint/format from node_modules.
* Referenced package must be installed
*/
// formatter: '@commitlint/format',
/*
* Any rules defined here will override rules from @commitlint/config-conventional
*/
rules: {},
/*
* Functions that return true if commitlint should ignore the given message.
*/
// ignores: [(commit) => commit === ''],
/*
* Whether commitlint uses the default ignore rules.
*/
// defaultIgnores: true,
/*
* Custom URL to show upon failure
*/
helpUrl:
'https://github.com/conventional-changelog/commitlint/#what-is-commitlint',
/*
* Custom prompt configs
*/
// prompt: {
// messages: {},
// questions: {
// type: {
// description: 'please input type:',
// },
// },
// },
};

export default Configuration;
5 changes: 3 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
dist
types/truffle-contracts
artifacts
cache
coverage
20 changes: 0 additions & 20 deletions .eslintrc

This file was deleted.

56 changes: 56 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
module.exports = {
extends: [
"eslint:recommended",
"plugin:mocha/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"prettier",
],
env: {
browser: false,
es2021: true,
mocha: true,
node: true,
},
// root: true,
plugins: ["@typescript-eslint", "mocha"],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
tsconfigRootDir: __dirname,
project: "./tsconfig.json",
},
rules: {
"lines-between-class-members": "error",
"padding-line-between-statements": [
"error",
{ blankLine: "always", prev: "*", next: "return" },
],
"prefer-const": [
"error",
{
destructuring: "any",
ignoreReadBeforeAssign: false,
},
],
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
"@typescript-eslint/naming-convention": [
"error",
{
selector: ["variable", "function"],
format: ["camelCase"],
},
{
selector: ["variable"],
modifiers: ["const"],
format: ["camelCase", "UPPER_CASE"],
},
],
"mocha/no-skipped-tests": "warn",
"mocha/no-empty-description": "off",
"mocha/no-exclusive-tests": "error",
"@typescript-eslint/no-unsafe-member-access": "warn"
},
};
31 changes: 7 additions & 24 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: CI for RIF-Relay-Contract
on: [push]
jobs:
lint:
lint&test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v2
with:
Expand All @@ -13,23 +13,11 @@ jobs:
- name: Install dependencies
run: npm install

- name: Check Linter bugs for Typescript
run: npm run lint:ts

- name: See bugs on solidity
run: npm run lint:sol

- name: Check Codestyles errors
run: npm run prettier

contract-test:
runs-on: ubuntu-latest
needs: [lint]
run: npm run ci:format

steps:
# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
uses: actions/checkout@v3
- name: Check Linter bugs for Typescript
run: npm run ci:lint

- name: Download rif-relay node configuration
run: |
Expand All @@ -39,10 +27,5 @@ jobs:
- name: Run docker image
run: docker run -d -p 127.0.0.1:4444:4444 -p 127.0.0.1:4445:4445 --name enveloping-rskj -it -v $PWD/logback.xml:/etc/rsk/logback.xml -v $PWD/node.conf:/etc/rsk/node.conf rsksmart/rskj:IRIS-3 --regtest

- name: Install dependencies
run: npm install

# Performs a clean installation of all dependencies in the `package.json` file
# For more information, see https://docs.npmjs.com/cli/ci.html
- name: Run contract test
run: npm run test
- name: Run tests
run: npm run ci:test
19 changes: 15 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
node_modules/
build/
dist/
package-lock.json
.npmignore
.eslintcache

node_modules
.env
coverage
coverage.json
typechain
typechain-types

#Hardhat files
cache
artifacts
/build
/dist
/contracts-exposed
1 change: 0 additions & 1 deletion .husky/.gitignore

This file was deleted.

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

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

if [ -d "$HOME/.nvm" ]; then
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
fi

npm run lint:ts
npm run lint:sol
npm run prettier:fix
npm run format
npm run lint
npx lint-staged
5 changes: 5 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run compile
npm run test
5 changes: 5 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
coverage
.gitignore
!dist
!typechain-types
test
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

21 changes: 5 additions & 16 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
.gitignore
.prettierignore
package.json
package-lock.json
prettierrc.json5
Readme.md
tsconfig.json
.eslintignore
.eslintrc
node_modules
.solhint.json
.solhintignore
webpack.config.js
build
dist
types/truffle-contracts
pull_request_template.md
artifacts
cache
coverage*
gasReporterOutput.json
typechain-types
22 changes: 22 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"overrides": [
{
"files": "*.ts",
"options": {
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5"
}
},
{
"files": "*.sol",
"options": {
"trailingComma": "none",
"tabWidth": 4,
"semi": true,
"singleQuote": false
}
}
]
}
10 changes: 0 additions & 10 deletions .prettierrc.json5

This file was deleted.

38 changes: 31 additions & 7 deletions .solhint.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,32 @@
{
"extends": "solhint:recommended",
"rules": {
"compiler-version": ["error","^0.6.12"],
"mark-callable-contracts": ["off"],
"reason-string": ["warn",{"maxLength":32}]
}
}
"extends": "solhint:recommended",
"plugins": [
"prettier"
],
"rules": {
"prettier/prettier": "error",
"compiler-version": [
"error",
"^0.6.12"
],
"avoid-suicide": "error",
"avoid-sha3": "warn",
"private-vars-leading-underscore": [
"error",
{
"strict": false
}
],
"code-complexity": [
"error",
7
],
"constructor-syntax": "error",
"func-visibility": [
"warn",
{
"ignoreConstructors": true
}
]
}
}
2 changes: 1 addition & 1 deletion .solhintignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
contracts/0x
node_modules
Loading

0 comments on commit cde87f0

Please sign in to comment.