Skip to content

Commit

Permalink
dev-deploy usage restricted on mainnet (#714)
Browse files Browse the repository at this point in the history
* dev-deploy usage restricted on mainnet
  • Loading branch information
volovyks authored Apr 29, 2021
1 parent 34660e7 commit 90ca53c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions commands/dev-deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ module.exports = {
};

async function devDeploy(options) {
if (options.networkId === 'mainnet') {
throw Error('MainNet doesn\'t support dev-deploy. Use export NEAR_ENV=testnet to switch to TestNet');
}
await eventtracking.askForConsentIfNeeded(options);
const { nodeUrl, helperUrl, masterAccount, wasmFile } = options;
if (!helperUrl && !masterAccount) {
Expand Down Expand Up @@ -77,8 +80,8 @@ async function createDevAccountIfNeeded({ near, keyStore, networkId, init, maste
}
}
let accountId;
// create random number with at least 7 digits
const randomNumber = Math.floor(Math.random() * (9999999 - 1000000) + 1000000);
// create random number with at least 14 digits
const randomNumber = Math.floor(Math.random() * (99999999999999 - 10000000000000) + 10000000000000);

if (masterAccount) {
accountId = `dev-${Date.now()}.${masterAccount}`;
Expand Down

0 comments on commit 90ca53c

Please sign in to comment.