Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
eternauta1337 committed Feb 29, 2024
1 parent 6cc5f6c commit 8db7263
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 15 deletions.
8 changes: 7 additions & 1 deletion packages/ethernaut-network/src/tasks/info.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { types } = require('hardhat/config')
const output = require('common/src/output')
const storage = require('../internal/storage')
const { chains } = require('common/src/chains')
Expand All @@ -6,7 +7,12 @@ const autocompleteAlias = require('./autocomplete/alias')

const info = require('../scopes/network')
.task('info', 'Provides information about a network')
.addOptionalPositionalParam('alias', 'The name or url of the network')
.addOptionalPositionalParam(
'alias',
'The name or url of the network',
undefined,
types.string,
)
.setAction(async ({ alias }, hre) => {
try {
if (!alias) {
Expand Down
15 changes: 13 additions & 2 deletions packages/ethernaut-network/src/tasks/node.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { types } = require('hardhat/config')
const output = require('common/src/output')
const { execSync } = require('child_process')
const { isUrl } = require('common/src/url')
Expand All @@ -7,8 +8,18 @@ const applyEnvVars = require('../internal/apply-env-vars')

const local = require('../scopes/network')
.task('node', 'Starts a local development chain, potentially with a fork.')
.addOptionalParam('fork', 'The alias or url of the network to fork')
.addOptionalParam('port', 'The port to run the local chain on')
.addOptionalParam(
'fork',
'The alias or url of the network to fork',
undefined,
types.string,
)
.addOptionalParam(
'port',
'The port to run the local chain on',
undefined,
types.string,
)
.setAction(async ({ fork, port }) => {
try {
const forkUrl = getForkUrl(fork)
Expand Down
7 changes: 0 additions & 7 deletions packages/ethernaut-network/test/scopes/net.test.js

This file was deleted.

7 changes: 7 additions & 0 deletions packages/ethernaut-network/test/scopes/network.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const assert = require('assert')

describe('network', function () {
it('has an "network" scope', async function () {
assert.notEqual(hre.scopes['network'], undefined)
})
})
2 changes: 1 addition & 1 deletion packages/ethernaut-ui/src/internal/make-interactive.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function makeInteractive(task) {
) {
return
}
debug.log(`Making task "${task.name}" interactive`, 'ui')
debug.log(`Making task "${task.name}" interactive`, 'ui-deep')

// TODO: Ai doesn't know how to handle flags
// TODO: This wont really work until I can parse args
Expand Down
4 changes: 2 additions & 2 deletions packages/ethernaut-ui/test/tasks/navigate-scope.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ describe('navigate scope', function () {
})

it('does not show utils', async function () {
terminal.notHas('to-bytes')
terminal.notHas('to-string')
terminal.notHas('bytes')
terminal.notHas('string')
terminal.notHas('unit')
})

Expand Down
8 changes: 7 additions & 1 deletion packages/ethernaut-wallet/src/tasks/info.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
const { types } = require('hardhat/config')
const output = require('common/src/output')
const storage = require('../internal/storage')
const autocompleteAlias = require('./autocomplete/alias')

const info = require('../scopes/wallet')
.task('info', 'Shows information about a wallet')
.addOptionalPositionalParam('alias', 'The name of the wallet')
.addOptionalPositionalParam(
'alias',
'The name of the wallet',
undefined,
types.string,
)
.setAction(async ({ alias }, hre) => {
try {
if (!alias) {
Expand Down
8 changes: 7 additions & 1 deletion packages/ethernaut-wallet/src/tasks/sign.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
const { types } = require('hardhat/config')
const output = require('common/src/output')
const storage = require('../internal/storage')
const { getWallet } = require('../internal/signers')

require('../scopes/wallet')
.task('sign', 'Signs a message with a wallet')
.addOptionalPositionalParam('message', 'The message to sign')
.addOptionalPositionalParam(
'message',
'The message to sign',
undefined,
types.string,
)
.setAction(async ({ message }) => {
try {
const signers = storage.readSigners()
Expand Down

0 comments on commit 8db7263

Please sign in to comment.