Skip to content

Commit

Permalink
feat: project upgrade (rsksmart#259)
Browse files Browse the repository at this point in the history
* PP-358: configure the project to use ethers (rsksmart#231)

* chore: update package version

* feat: replace truffle/web3 with hardhat

* chore: add clean script in package.json

* test: fix hardhat network

* fix: remove unnecessary peer dependency

* fix: use the contracts from the root folder instead of dist

* chore: rename prettierrc to prettierrc.json5 for consistency across all the project

* chore: update package-lock.json

* chore: update rif-relay-contracts dependency

* PP-661: replace circleci with gh actions (rsksmart#236)

* build: add the build step in the prepare script

* chore: replace circleci with github action

* chore: rename workflow and use local rsk files

* fix: use rskj version 4.1.1

* fix: apply format rules to yml files

* PP-642/migrate-test-utils-server (rsksmart#233)

* refactor: remove smartWalletFactory

* refactor(TestUtils): error handling

* refactor: remove unnecessary files

* refactor(TestUtils): wallet per owner

* PP-640/custom smart wallet (rsksmart#234)

* PP639: Migrate SmartWallet tests (rsksmart#232)

* feat: migrate the RIFSmartWallet integration tests

* refactor: implement @MetaMask signatures

* fix: change the way we create smart wallets
use ethers provider instead of hardhat
rename files

---------

Co-authored-by: Antonio Morrone <[email protected]>

* PP638: Migrate verifiers tests (rsksmart#240)

* feat: migrate DeployVerifier integration test.

* PP-636/relay-hub-tests (rsksmart#239)

* feat: refactor relayHub tests

---------

Co-authored-by: Christos Otarola <[email protected]>
Co-authored-by: Antonio Morrone <[email protected]>

* PP-633/relay-server-tests (rsksmart#238)

* test(RelayServer): refactoring tests

* refactor(RelayServer): simplify relay transaction build

* refactor: buildServerUrl

* refactor: based on PR comments

* chore: dependency update

* refactor: rebase

* PP-634/registration-manager-tests (rsksmart#242)

* test: migrate the registration manager tests

* PP-637: relay hub gas consumption tests (rsksmart#243)

* feat: refactor of gas tests
* fix: reduce concatenated messages, log lines, deploy hub util

* PP-680: remove buildServerUrl usage (rsksmart#244)

* fix: remove the buildServerUrl usage
* fix: remove non-null assertion

* PP-686: gas estimation task (rsksmart#245)

* feat: ported gas estimation tests to script

* PP-635/relay-client-tests (rsksmart#246)

* test(RelayClient): migration of the existing integration tests
* refactor: use already defined deployContract function

---------

Co-authored-by: Francisco Tobar <[email protected]>
Co-authored-by: Antonio Morrone <[email protected]>

* PP719: Adapt estimation script to calculate the cost of a deployment (rsksmart#247)


* feat: add gas estimation for deploy

* feat: add additional estimation with token payment

* refactor: refactor the script to make it more readable
---------

Co-authored-by: Antonio Morrone <[email protected]>

* fix/verify_with_relay_hub (rsksmart#250)

* refactor(RelayClient): verify with relay hub

* build: dependency update

* ci: update the rskj node version and configuration (rsksmart#252)

* PP-803/optimize server startup (rsksmart#254)

* test: fix failing tests

* PP-842: fix underpriced transactions (rsksmart#255)

* test: fix broken tests

* test: include tests to cover relay server fixes

* chore: move expectation outside the test

* build: version / relay-server dependency

---------

Co-authored-by: Francisco Tobar <[email protected]>

* fix: remove unused tests (rsksmart#258)

* Update Readme.md

Co-authored-by: franciscotobar <[email protected]>

* Update Readme.md

Co-authored-by: franciscotobar <[email protected]>

* Update Readme.md

Co-authored-by: franciscotobar <[email protected]>

* Update Readme.md

Co-authored-by: franciscotobar <[email protected]>

* Update scripts/GasEstimation.ts

Co-authored-by: franciscotobar <[email protected]>

* style: apply format rule

* docs: readme

---------

Co-authored-by: franciscotobar <[email protected]>
Co-authored-by: Christos Otarola <[email protected]>
Co-authored-by: AndresQuijano <[email protected]>
Co-authored-by: Christos Otarola <[email protected]>
Co-authored-by: Francisco Tobar <[email protected]>
  • Loading branch information
6 people authored Jan 5, 2024
1 parent 0251e19 commit ce5bee2
Show file tree
Hide file tree
Showing 115 changed files with 26,545 additions and 96,208 deletions.
139 changes: 0 additions & 139 deletions .circleci/config.yml

This file was deleted.

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: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
node_modules
artifacts
cache
coverage
dist
# FIXME: to be removed
test-to-migrate
17 changes: 0 additions & 17 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"]
},
};
26 changes: 26 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: RIF Relay integration/e2e tests
on: [push]
jobs:
format_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 ci --no-audit

- name: Check Codestyles errors
run: npm run format

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

- 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/docker/logback.xml:/etc/rsk/logback.xml -v $PWD/docker/node.conf:/etc/rsk/node.conf rsksmart/rskj:FINGERROOT-5.0.0 --regtest

- name: Run tests
run: npm run test -- --network regtest
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ docker/src/
dockers/
tsconfig.
yarn.lock
contracts
migrations
contract-addresses.json
typechain-types
txstore.db
manager/keystore
workers/keystore
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
3 changes: 2 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ if [ -d "$HOME/.nvm" ]; then
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
fi

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

npm run test
4 changes: 4 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"require": "ts-node/register/transpile-only",
"spec": "./test/*.test.ts"
}
17 changes: 5 additions & 12 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
.gitignore
.github
.prettierignore
package.json
package-lock.json
prettierrc.json5
Readme.md
tsconfig.json
.eslintignore
.eslintrc
node_modules
webpack.config.js
build
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 ce5bee2

Please sign in to comment.