Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1058 from soonnear/master
Browse files Browse the repository at this point in the history
Error message for undefined node directly includes network name
  • Loading branch information
SoonNear authored Mar 28, 2023
2 parents 47e6561 + 24b5d26 commit aff742d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function getConfig(env) {
case 'local':
case 'localnet':
config = {
networkId: process.env.NEAR_CLI_LOCALNET_NETWORK_ID || 'local',
networkId: process.env.NEAR_CLI_LOCALNET_NETWORK_ID || 'localnet',
nodeUrl: process.env.NEAR_CLI_LOCALNET_RPC_SERVER_URL || process.env.NEAR_NODE_URL || 'http://127.0.0.1:3030',
keyPath: process.env.NEAR_CLI_LOCALNET_KEY_PATH || `${process.env.HOME}/.near/validator_key.json`,
walletUrl: process.env.NEAR_WALLET_URL || 'http://localhost:4000/wallet',
Expand Down
8 changes: 1 addition & 7 deletions utils/inspect-response.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,7 @@ const checkForAccDoesNotExist = (error, options) => {
// below is optional approach, but "alias" in command options is better
// const accountId = (options.accountId)? options.accountId : options.contractName;
const currentNetwork = config.helperAccount;
if (currentNetwork in suffixesToNetworks) {
console.log(chalk`\n{bold.red Account {bold.white ${options.accountId}} is not found in {bold.white ${suffixesToNetworks[currentNetwork]}}\n}`);
}
else {
console.log(chalk`\n{bold.red Account {bold.white ${options.accountId}} is not found in an undefined network: {bold.white ${currentNetwork}}\n}`);
}

console.log(chalk`\n{bold.red Account {bold.white ${options.accountId}} is not found in {bold.white ${config.networkId}}\n}`);
const accSuffix = String(options.accountId).match('[^.]*$')[0];
const accNetwork = suffixesToNetworks[accSuffix];
if (currentNetwork != accSuffix && accNetwork) {
Expand Down

0 comments on commit aff742d

Please sign in to comment.