This repository has been archived by the owner on Oct 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
171dcf3
commit 74ec085
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
const exitOnError = require('../utils/exit-on-error'); | ||
const { utils } = require('near-web3-provider'); | ||
const connect = require('../utils/connect'); | ||
|
||
module.exports = { | ||
command: 'evm-dev-init <accountId> [numAccounts]', | ||
desc: 'Creates test accounts using NEAR Web3 Provider', | ||
builder: (yargs) => yargs | ||
.option('accountId', { | ||
desc: 'NEAR account creating the test subaccounts', | ||
type: 'string', | ||
default: '0' | ||
}) | ||
.option('numAccounts', { | ||
desc: 'Number of test accounts to create', | ||
type: 'number', | ||
default: '5' | ||
}), | ||
handler: exitOnError(scheduleEVMDevInit) | ||
}; | ||
|
||
async function scheduleEVMDevInit(options) { | ||
const near = await connect(options); | ||
const account = await near.account(options.accountId); | ||
await utils.createTestAccounts(account, options.numAccounts); | ||
} |