diff --git a/bin/commands/account.js b/bin/commands/account.js index ba2bdc4e..2d19d16a 100644 --- a/bin/commands/account.js +++ b/bin/commands/account.js @@ -183,7 +183,7 @@ async function getAccountNonce (walletPath, options) { async function createSecureWallet (walletPath, { output, password, overwrite }) { try { await generateSecureWallet(walletPath, { output, password, overwrite }) - process.exit(1) + process.exit(0) } catch (e) { printError(e.message) } @@ -194,7 +194,7 @@ async function createSecureWallet (walletPath, { output, password, overwrite }) async function createSecureWalletByPrivKey (walletPath, priv, { output, password, overwrite }) { try { await generateSecureWalletFromPrivKey(walletPath, priv, { output, password, overwrite }) - process.exit(1) + process.exit(0) } catch (e) { printError(e.message) } diff --git a/bin/commands/chain.js b/bin/commands/chain.js index 204a844b..ca528e53 100644 --- a/bin/commands/chain.js +++ b/bin/commands/chain.js @@ -35,7 +35,7 @@ async function version (options) { const status = await client.api.getStatus() if (json) { print(status) - process.exit(1) + process.exit(0) } printUnderscored(`Difficulty`, status.difficulty) printUnderscored(`Node version`, status.nodeVersion) @@ -65,7 +65,7 @@ async function getNetworkId (options) { const { networkId } = await client.api.getStatus() if (json) { print({ networkId }) - process.exit(1) + process.exit(0) } printUnderscored(`Network ID`, networkId) }) @@ -86,7 +86,7 @@ async function ttl (absoluteTtl, options) { const height = await client.height() if (json) { print({ absoluteTtl, relativeTtl: +height + +absoluteTtl }) - process.exit(1) + process.exit(0) } printUnderscored('Absolute TTL', absoluteTtl) printUnderscored('Relative TTL', +height + +absoluteTtl) diff --git a/bin/commands/inspect.js b/bin/commands/inspect.js index 935aba10..46340240 100644 --- a/bin/commands/inspect.js +++ b/bin/commands/inspect.js @@ -119,7 +119,7 @@ async function unpackTx (hash, options = {}) { const { validation, tx, signatures = [], txType: type } = await client.unpackAndVerify(hash) if (json) { print({ validation, tx: tx, signatures, type }) - process.exit(1) + process.exit(0) } printValidation({ validation, tx: { ...tx, signatures: signatures.map(el => el.hash) }, txType: type }) if (!validation.length) print(' ✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓ TX VALID ✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓') diff --git a/bin/commands/transaction.js b/bin/commands/transaction.js index e1bf2233..aaf071a8 100644 --- a/bin/commands/transaction.js +++ b/bin/commands/transaction.js @@ -453,7 +453,7 @@ async function verify (txHash, options) { const { validation, tx, signatures = [], txType: type } = await client.unpackAndVerify(txHash, { networkId }) if (json) { print({ validation, tx: tx, signatures, type }) - process.exit(1) + process.exit(0) } printValidation({ validation, tx: { ...tx, signatures: signatures.map(el => el.hash) }, txType: type }) if (!validation.length) print(' ✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓ TX VALID ✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓') diff --git a/bin/utils/account.js b/bin/utils/account.js index 64805006..9c699173 100644 --- a/bin/utils/account.js +++ b/bin/utils/account.js @@ -34,7 +34,7 @@ export async function askForOverwrite (name, output) { // Generate `keypair` encrypt it using password and write to `ethereum` keystore file export async function generateSecureWallet (name, { output = '', password, overwrite }) { - if (!overwrite && !(await askForOverwrite(name, output))) process.exit(0) + if (!overwrite && !(await askForOverwrite(name, output))) process.exit(1) password = password || await prompt(PROMPT_TYPE.askPassword) const { secretKey, publicKey } = Crypto.generateKeyPair(true) @@ -46,7 +46,7 @@ export async function generateSecureWallet (name, { output = '', password, overw // Generate `keypair` from `PRIVATE KEY` encrypt it using password and to `ethereum` keystore file export async function generateSecureWalletFromPrivKey (name, priv, { output = '', password, overwrite }) { - if (!overwrite && !(await askForOverwrite(name, output))) process.exit(0) + if (!overwrite && !(await askForOverwrite(name, output))) process.exit(1) password = password || await prompt(PROMPT_TYPE.askPassword) const hexStr = Crypto.hexStringToByte(priv.trim())