Skip to content

Commit

Permalink
Port wallet-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
eternauta1337 committed Mar 2, 2024
1 parent d54eb0b commit cf17738
Show file tree
Hide file tree
Showing 18 changed files with 4,359 additions and 44 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,27 @@ jobs:
npm run chain &
sleep 5
- run: cd packages/ethernaut-wallet && npm t
ethernaut-wallet-ui:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm run compile --if-present
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Start local chain
run: |
npm run chain &
sleep 5
- run: cd packages/ethernaut-wallet-ui && npm t
ethernaut-cli:
runs-on: ubuntu-latest
strategy:
Expand Down
13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions packages/ethernaut-cli/hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ require('ethernaut-interact')
require('ethernaut-ai')
require('ethernaut-challenges')
require('ethernaut-network')
require('ethernaut-network-ui')
require('ethernaut-wallet')
require('ethernaut-wallet-ui')
require('ethernaut-ui')
require('ethernaut-util-ui')

Expand Down
23 changes: 23 additions & 0 deletions packages/ethernaut-wallet-ui/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "ethernaut-wallet-ui",
"version": "1.0.0",
"description": "Ui expensions for the ethernaut-util package",
"main": "src/index.js",
"scripts": {
"build": "npm run install:test",
"compile": "echo 'No compile step'",
"install:test": "cd test/fixture-projects/basic-project && npm install",
"test": "nyc mocha --exit --timeout 60000 --require 'test/setup.js' --recursive '../../**/*.test.js' --ignore '../../fixture-projects/**/*'"
},
"author": "",
"license": "ISC",
"devDependencies": {
"hardhat": "^2.20.0",
"mocha": "^10.3.0",
"nyc": "^15.1.0"
},
"directories": {
"test": "test"
},
"keywords": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = function setup(hre) {
const activate = hre.scopes.network.tasks.activate

activate.positionalParamDefinitions.find(
(p) => p.name === 'alias',
).autocomplete = require('../params/alias')('Select a wallet to activate')
}
6 changes: 6 additions & 0 deletions packages/ethernaut-wallet-ui/src/autocomplete/tasks/info.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = function setup(hre) {
const info = hre.scopes.network.tasks.info

info.positionalParamDefinitions.find((p) => p.name === 'alias').autocomplete =
require('../params/alias')('Select a wallet')
}
7 changes: 7 additions & 0 deletions packages/ethernaut-wallet-ui/src/autocomplete/tasks/remove.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = function setup(hre) {
const remove = hre.scopes.network.tasks.remove

remove.positionalParamDefinitions.find(
(p) => p.name === 'alias',
).autocomplete = require('../params/alias')('Select a wallet to remove')
}
10 changes: 10 additions & 0 deletions packages/ethernaut-wallet-ui/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const { extendEnvironment } = require('hardhat/config')

require('ethernaut-ui/src/index')
require('ethernaut-wallet/src/index')

extendEnvironment((hre) => {
require('./autocomplete/tasks/activate')(hre)
require('./autocomplete/tasks/info')(hre)
require('./autocomplete/tasks/remove')(hre)
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/** @type import('hardhat/config').HardhatUserConfig */
require('@nomicfoundation/hardhat-ethers')
require('../../../src/index')

module.exports = {
solidity: '0.8.24',
defaultNetwork: 'local',
networks: {
local: {
url: 'http://localhost:8545',
},
},
}
Loading

0 comments on commit cf17738

Please sign in to comment.