Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💅 tests #648

Merged
merged 14 commits into from
Feb 22, 2023
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
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
3 changes: 2 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ charset = utf-8
indent_style = space
indent_size = 4

[*.{js,yml}]
[*.{js,yml,json,cjs}]
indent_size = 2
max_line_length = 120
28 changes: 11 additions & 17 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,45 +1,39 @@
{
"plugins": ["prettier", "standard"],
"env": {
"node": true,
"es2020": true
"es2022": true
},
"extends": ["standard", "plugin:prettier/recommended", "prettier", "prettier/standard"],
"parser": "babel-eslint",
"extends": ["standard", "plugin:prettier/recommended"],
"parserOptions": {
"ecmaVersion": 8,
"sourceType": "module",
"ecmaVersion": 2022,
"sourceType": "script",
"ecmaFeatures": {
"jsx": true,
"modules": true
"jsx": true
}
},
"plugins": ["node", "prettier", "standard"],

"rules": {
"prettier/prettier": "error",
"max-len": ["warn", { "code": 140, "ignoreComments": true, "ignoreUrls": true }],
"no-undef": "warn",
"no-unused-vars": "warn",
"prefer-const": "warn",
"camelcase": "off",
"eol-last": "warn",
"no-multiple-empty-lines": "warn",
"comma-dangle": "warn",
"quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }],
"jsx-quotes": ["error", "prefer-single"],
"no-useless-escape": "off",
"linebreak-style": ["error", "unix"]
"linebreak-style": ["error", "unix"],
"no-restricted-modules": ["error", {
"name": "@aragon/contract-helpers-test/src/asserts",
"message": "Please use helpers/assert instead."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍
though, maybe it's better to make the fix more precise (specify path from the project's root)

}]
},
"overrides": [
{
"files": ["./scripts/{**/,}*.js", "./test/{**/,}*.js", "./e2e/test/{**/,}*.js"],
"env": {
"mocha": true
},
"globals": {
"artifacts": "readonly",
"contract": "readonly",
"web3": "readonly"
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ cli/vendor

# foundry artifacts
foundry/cache
foundry/out
foundry/out
4 changes: 2 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
. "$(dirname -- "$0")/_/husky.sh"

yarn compile
git diff --quiet lib/abi
yarn lint:sol

# TODO: uncomment. it's temporarily disabled on staking_router + withdrawals-poc merge
# yarn lint:js:fix
yarn lint:js:fix
17 changes: 3 additions & 14 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
{
"singleQuote": true,
"semi": false,
"trailingComma": "none",
"bracketSpacing": true,
"jsxBracketSameLine": false,
"printWidth": 120,
"overrides": [
{
"files": "*.sol",
"options": {
"printWidth": 120,
"tabWidth": 4,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": false
}
}
]
"options": {
"editorconfig": true
}
}
18 changes: 9 additions & 9 deletions apps/lido/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,25 @@
"yup": "^0.29.3"
},
"devDependencies": {
"@babel/core": "^7.11.6",
"@babel/core": "^7.21.0",
"@babel/preset-env": "^7.11.5",
"@babel/preset-react": "^7.10.1",
"babel-eslint": "^10.1.0",
"babel-plugin-styled-components": "^1.11.1",
"copyfiles": "^2.3.0",
"eslint": "^7.9.0",
"eslint-config-prettier": "^6.11.0",
"eslint-config-standard": "^14.1.1",
"eslint": "^8.34.0",
"eslint-config-prettier": "^8.6.0",
"eslint-config-standard": "^17.0.0",
"eslint-config-standard-react": "^9.2.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.20.6",
"eslint-plugin-react-hooks": "^4.1.2",
"eslint-plugin-standard": "^4.0.1",
"eslint-plugin-standard": "^5.0.0",
"parcel-bundler": "^1.12.4",
"prettier": "^2.1.2"
"prettier": "^2.8.4"
},
"scripts": {
"build": "yarn sync-assets && yarn build:app && yarn build:script",
Expand Down
6 changes: 3 additions & 3 deletions apps/lido/hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
...baseConfig,
paths: {
...baseConfig.paths,
root: '../..'
root: '../..',
},
defaultNetwork: process.env.NETWORK_NAME || 'localhost',
// Aragon plugin configuration
Expand All @@ -18,6 +18,6 @@ module.exports = {
appSrcPath: 'apps/lido/app/',
appBuildOutputPath: 'apps/lido/dist/',
appName: 'lido',
hooks // Path to script hooks
}
hooks, // Path to script hooks
},
}
2 changes: 1 addition & 1 deletion apps/lido/scripts/buidler-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ module.exports = {
},

// Called after the app's proxy is updated with a new implementation.
postUpdate: async ({ proxy, log }, { web3, artifacts }) => {}
postUpdate: async ({ proxy, log }, { web3, artifacts }) => {},
}
18 changes: 9 additions & 9 deletions apps/node-operators-registry/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@
"yup": "^0.29.3"
},
"devDependencies": {
"@babel/core": "^7.11.6",
"@babel/core": "^7.21.0",
"@babel/preset-env": "^7.11.5",
"@babel/preset-react": "^7.10.1",
"babel-eslint": "^10.1.0",
"babel-plugin-styled-components": "^1.11.1",
"copyfiles": "^2.3.0",
"eslint": "^7.9.0",
"eslint-config-prettier": "^6.11.0",
"eslint-config-standard": "^14.1.1",
"eslint": "^8.34.0",
"eslint-config-prettier": "^8.6.0",
"eslint-config-standard": "^17.0.0",
"eslint-config-standard-react": "^9.2.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.20.6",
"eslint-plugin-react-hooks": "^4.1.2",
"eslint-plugin-standard": "^4.0.1",
"eslint-plugin-standard": "^5.0.0",
"parcel-bundler": "^1.12.4",
"prettier": "^2.1.2"
"prettier": "^2.8.4"
},
"scripts": {
"build": "yarn sync-assets && yarn build:app && yarn build:script",
Expand Down
6 changes: 3 additions & 3 deletions apps/node-operators-registry/hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
...baseConfig,
paths: {
...baseConfig.paths,
root: '../..'
root: '../..',
},
defaultNetwork: process.env.NETWORK_NAME || 'localhost',
// Aragon plugin configuration
Expand All @@ -18,6 +18,6 @@ module.exports = {
appSrcPath: 'apps/node-operators-registry/app/',
appBuildOutputPath: 'apps/node-operators-registry/dist/',
appName: 'node-operators-registry',
hooks // Path to script hooks
}
hooks, // Path to script hooks
},
}
2 changes: 1 addition & 1 deletion apps/node-operators-registry/scripts/buidler-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ module.exports = {
},

// Called after the app's proxy is updated with a new implementation.
postUpdate: async ({ proxy, log }, { web3, artifacts }) => {}
postUpdate: async ({ proxy, log }, { web3, artifacts }) => {},
}
6 changes: 3 additions & 3 deletions ava.config.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
require: ['@babel/register'],
files: ['e2e/test/**/*.test.js'],
concurrency: 5
require: ['@babel/register'],
files: ['e2e/test/**/*.test.js'],
concurrency: 5,
}
12 changes: 8 additions & 4 deletions gasprofile/tx-deposit.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ async function main() {
user1,
user2,
// an unrelated address
nobody
nobody,
] = addresses

const deployed = await deployDaoAndPool(appManager, voting, 100)
Expand All @@ -38,14 +38,18 @@ async function main() {
const numKeys = 3

for (let iProvider = 0; iProvider < numProviders; ++iProvider) {
const nosTx = await nodeOperatorRegistry.addNodeOperator(`NOS-${iProvider}`, nodeOperator, nosValidatorsLimit, { from: voting })
const nodeOperatorId = getEventArgument(nosTx, 'NodeOperatorAdded', 'nodeOperatorId', { decodeForAbi: NodeOperatorsRegistry._json.abi })
const nosTx = await nodeOperatorRegistry.addNodeOperator(`NOS-${iProvider}`, nodeOperator, nosValidatorsLimit, {
from: voting,
})
const nodeOperatorId = getEventArgument(nosTx, 'NodeOperatorAdded', 'nodeOperatorId', {
decodeForAbi: NodeOperatorsRegistry._json.abi,
})

const data = Array.from({ length: numKeys }, (_, iKey) => {
const n = arbitraryN.clone().addn(10 * iKey + 1000 * iProvider)
return {
key: pad(`0x${n.toString(16)}`, 48, 'd'),
sig: pad(`0x${n.toString(16)}`, 96, 'e')
sig: pad(`0x${n.toString(16)}`, 96, 'e'),
}
})

Expand Down
4 changes: 2 additions & 2 deletions hardhat.config.aragon-apps.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ module.exports = {
...baseConfig,
aragon: {
...baseConfig.aragon,
...aragonConfig
}
...aragonConfig,
},
}
Loading