Skip to content

Commit abb852f

Browse files
Long NguyenlongnguyenTM
authored andcommitted
correct mis-spelled words and change parameter name.
1 parent bf62d71 commit abb852f

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

app/sign.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,12 @@ const getHDNodeAndVerify = function(xprv, expectedXpub) {
101101
/**
102102
* Prints the recovery transaction information and prompt for the confirmation as well as the key, if needed to.
103103
* @param recoveryRequest The recovery transansaction request object.
104-
* @param key The provided private key of the wallet.
105104
* @param outputs The outputs of the transaction.
106105
* @param skipConfirm The boolean value that indicates to whether or not to prompt the user to confirm the transaction.
106+
* @param [key] The provided private key of the wallet.
107107
* @returns The private key of the wallet.
108108
*/
109-
const promptForConfirmatioAndKey = function(recoveryRequest, key, outputs, skipConfirm) {
109+
const promptForConfirmationAndKey = function(recoveryRequest, outputs, skipConfirm, key) {
110110
const customMessage = recoveryRequest.custom ? recoveryRequest.custom.message : 'None';
111111
confirmRecovery(recoveryRequest.backupKey, outputs, customMessage, skipConfirm);
112112

@@ -146,7 +146,7 @@ const handleSignUtxo = function(recoveryRequest, key, skipConfirm) {
146146
amount: ( new BN(out.value) ).div( TEN.pow(decimals) ).toString()
147147
}));
148148

149-
key = promptForConfirmatioAndKey(recoveryRequest, key, outputs, skipConfirm);
149+
key = promptForConfirmationAndKey(recoveryRequest, outputs, skipConfirm, key);
150150

151151
const backupKeyNode = getHDNodeAndVerify(key, recoveryRequest.backupKey);
152152

@@ -213,11 +213,11 @@ const handleSignEthereum = function(recoveryRequest, key, skipConfirm) {
213213
* Signs an Ethereum transaction.
214214
* @param recoveryRequest The recovery request object.
215215
* @param key The provided private key of the wallet.
216-
* @param kipConfirm The boolean value that indicates to whether or not to prompt the user to confirm the transaction.
217-
* @param isCoinToken The boolean value that indicates if the transaction is for erc20 or ETH.
216+
* @param skipConfirm The boolean value that indicates to whether or not to prompt the user to confirm the transaction.
217+
* @param isToken The boolean value that indicates if the transaction is for erc20 or ETH.
218218
* @returns The 'hex' value of the signed transaction.
219219
*/
220-
const signEthTx = function(recoveryRequest, key, skipConfirm, isCoinToken) {
220+
const signEthTx = function(recoveryRequest, key, skipConfirm, isToken) {
221221
const EthTx = require('ethereumjs-tx');
222222

223223
const txHex = getTransactionHexFromRequest(recoveryRequest);
@@ -231,12 +231,12 @@ const signEthTx = function(recoveryRequest, key, skipConfirm, isCoinToken) {
231231
}];
232232

233233
// if request is for ETH, need to correct the amount decimals.
234-
if (!isCoinToken) {
234+
if (!isToken) {
235235
const decimals = coinDecimals[recoveryRequest.coin];
236236
outputs[0].amount = outputs[0].amount.div(TEN.pow(decimals));
237237
}
238238

239-
key = promptForConfirmatioAndKey(recoveryRequest, key, outputs, skipConfirm);
239+
key = promptForConfirmationAndKey(recoveryRequest, outputs, skipConfirm, key);
240240

241241
transaction.sign(getBackupSigningKey(key, recoveryRequest.backupKey));
242242

@@ -257,7 +257,7 @@ const handleSignTrx = function(recoveryRequest, key, skipConfirm) {
257257
};
258258
});
259259

260-
key = promptForConfirmatioAndKey(recoveryRequest, key, outputs, skipConfirm);
260+
key = promptForConfirmationAndKey(recoveryRequest, outputs, skipConfirm, key);
261261

262262
builder.sign({ key: getBackupSigningKey(key, recoveryRequest.backupKey) });
263263
return JSON.stringify(builder.build().toJson());
@@ -284,7 +284,7 @@ const handleSignEos = function(recoveryRequest, key, skipConfirm) {
284284
amount: new BN(amount)
285285
}];
286286

287-
key = promptForConfirmatioAndKey(recoveryRequest, key, outputs, skipConfirm);
287+
key = promptForConfirmationAndKey(recoveryRequest, outputs, skipConfirm, key);
288288

289289
const dataToSign = utils.getEOSSignatureData(packed_trx, chainId);
290290
const signBuffer = Buffer.from(dataToSign, 'hex');
@@ -313,7 +313,7 @@ const handleSignXrp = function(recoveryRequest, key, skipConfirm) {
313313
amount: (new BN(transaction.Amount)).div(TEN.pow(decimals))
314314
}];
315315

316-
key = promptForConfirmatioAndKey(recoveryRequest, key, outputs, skipConfirm);
316+
key = promptForConfirmationAndKey(recoveryRequest, outputs, skipConfirm, key);
317317

318318
const backupKeyNode = getHDNodeAndVerify(key, recoveryRequest.backupKey);
319319

@@ -349,7 +349,7 @@ const handleSignXlm = function(recoveryRequest, key, skipConfirm) {
349349
amount: transaction.operations[0].amount || transaction.operations[0].startingBalance
350350
}];
351351

352-
key = promptForConfirmatioAndKey(recoveryRequest, key, outputs, skipConfirm);
352+
key = promptForConfirmationAndKey(recoveryRequest, outputs, skipConfirm, key);
353353

354354
let backupKeypair;
355355

0 commit comments

Comments
 (0)