Skip to content

Commit

Permalink
feat: project upgrade (#115)
Browse files Browse the repository at this point in the history
feat(upgrade): re-create project with hardhat & ethers removing truffle and web3

* PP-565: migrate the removeTokens script to use Hardhat and Ethers.js (#92)
* fix: fix the task in hardhat.config, update Readme and apply format
* PP-566: migrate script deploy collector (#95)
* test: add the tests, remove the positional arguments and simplify the output file
* Rename the input config file parameter
* PP-569: migrate change partners (#97)
* chore: change package.json version
* feat: migrate the change-partners script to use ether.js
* fix: change the parseJsonFile function to return undefined
* fix: apply PR suggestions
* fix: remove the script from package.json and update Readme.md
* PP-567 Migrate Withdraw Task (#93)
* feat: new hardhat task
* feat: create withdraw task
* feat: complete withdrawal task and tests
* fix: no from parameter on withdraw
* feat: reorganize tasks and tests
* fix: restore .prepare script
* fix: no prepare task
* chore: remove unneeded rules
* fix: change Readme.md to fix the command instruction
* fix: restore the collector:deploy sample config file
* PP-355/update-rif-relay-server (#96)
* refactor(index): expose typing for relay-server
* fix: fix the collector and add the missing tests
* Fix the collector updateRemainderAddress
* Include the missing test for the stakeForAddress method
* fix: add config to use custom signers to run scripts (#106)
* feat: expiration mechanism (#105)
* feat: expiration mechanism
* feat: validate time on deploy
* PP-602/RelayClient: _validateSmartWallet (#109)
* refactor(SmartWallet): expose getOwner
* refactor(index): expose PromiseOrValue
* chore: github workflow
* PP-358: include the contracts in dist (#112)
* fix: remove contracts from npmignore
* PP-357: Add a task to mint utility tokens (#113)
* feat: add a task to mint utility tokens
* fix: apply linting and format to tasks
* refactor: expose RelayHubInterface
* docs: readme

* 2.0.0-beta.0
* fix: replace master with main on codeql workflow (#116)
* fix: comment the NativeHolderSmartWallet unit tests and fix IForwarder

---------
Co-authored-by: Antonio Morrone <antonio@iovlabs.org>
Co-authored-by: Juraj <juraj.piar@icloud.com>
Co-authored-by: Francisco Tobar <francisco.tobar@iovlabs.org>
Co-authored-by: Christos Otarola <christos@Christoss-MacBook-Pro.local>
  • Loading branch information
4 people authored Feb 6, 2023
1 parent 0b19b23 commit b15dc10
Show file tree
Hide file tree
Showing 157 changed files with 27,594 additions and 65,944 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;
6 changes: 4 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
node_modules
dist
types/truffle-contracts
artifacts
cache
coverage
dist
20 changes: 0 additions & 20 deletions .eslintrc

This file was deleted.

57 changes: 57 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
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",
"eol-last": ["error", "always"]
},
};
12 changes: 6 additions & 6 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: 'CodeQL'

on:
push:
branches: ['master']
pull_request:
branches: ['master']
schedule:
- cron: '40 22 * * 6'
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: "40 22 * * 6"

jobs:
analyze:
Expand Down
78 changes: 28 additions & 50 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,31 @@
name: CI for RIF-Relay-Contract
on: [push]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '16.x'

- 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]

steps:
# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
uses: actions/checkout@v3

- name: Download rif-relay node configuration
run: |
wget https://raw.githubusercontent.com/rsksmart/rif-relay/develop/docker/node.conf
wget https://raw.githubusercontent.com/rsksmart/rif-relay/develop/docker/logback.xml
- 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 with truffle
run: npm run test:truffle

# 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 with waffle
run: npm run test
lint_and_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "16.x"

- name: Install dependencies
run: npm install

- name: Check Codestyles errors
run: npm run ci:format

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

- name: Download rif-relay node configuration
run: |
wget https://raw.githubusercontent.com/rsksmart/rif-relay/main/docker/node.conf
wget https://raw.githubusercontent.com/rsksmart/rif-relay/main/docker/logback.xml
- 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: Run tests
run: npm run ci:test
22 changes: 18 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
node_modules/
build/
dist/
.npmignore
package-lock.json
.eslintcache

node_modules
.env
coverage
coverage.json
typechain
typechain-types

#Hardhat files
cache
artifacts
/build
/dist
/contracts-exposed

.vscode
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 build
npm run test
20 changes: 20 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/.github
/.husky
/scripts
/typechain-types
/test
/utils
/tsconfig.json
/tsconfig.build.json
/index.ts
/hardhat.config.ts
/.commitlintrc.ts
/.eslintignore
/.eslintrc.cjs
/.npmignore
/.prettierignore
/.prettierrc
/.solhint.json
/.solhintignore
!dist
!artifacts
22 changes: 6 additions & 16 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
.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
dist
28 changes: 20 additions & 8 deletions .prettierrc.json5
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
{
trailingComma: 'none',
tabWidth: 4,
semi: true,
singleQuote: true,
jsxSingleQuote: true,
bracketSpacing: true,
jsxBracketSameLine: true,
arrowParens: 'always'
"overrides": [
{
"files": "*.ts",
"options": {
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5"
}
},
{
"files": "*.sol",
"options": {
"trailingComma": "none",
"tabWidth": 4,
"semi": true,
"singleQuote": false
}
}
]
}
Loading

0 comments on commit b15dc10

Please sign in to comment.