aboutsummaryrefslogtreecommitdiffstats
path: root/packages/testnet-faucets/src/ts/id_management.ts
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-02-06 08:28:03 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-02-06 10:11:26 +0800
commit83d0bad3a1e6635dedb46fbd99ee1bec5246d4bf (patch)
tree626fd908627a4b6b7e48c3b7326c12a1f30c2f5f /packages/testnet-faucets/src/ts/id_management.ts
parent99b1f81e89e3ac929c7829552ea7ae19998524e9 (diff)
downloaddexon-0x-contracts-83d0bad3a1e6635dedb46fbd99ee1bec5246d4bf.tar.gz
dexon-0x-contracts-83d0bad3a1e6635dedb46fbd99ee1bec5246d4bf.tar.zst
dexon-0x-contracts-83d0bad3a1e6635dedb46fbd99ee1bec5246d4bf.zip
Addressed comments and update 0xProject/types-ethereumjs-util deps
Diffstat (limited to 'packages/testnet-faucets/src/ts/id_management.ts')
-rw-r--r--packages/testnet-faucets/src/ts/id_management.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/testnet-faucets/src/ts/id_management.ts b/packages/testnet-faucets/src/ts/id_management.ts
index b088e6cf8..7c598f91c 100644
--- a/packages/testnet-faucets/src/ts/id_management.ts
+++ b/packages/testnet-faucets/src/ts/id_management.ts
@@ -21,12 +21,12 @@ export const idManagement = {
callback(null, rawTx);
},
signMessage(message: object, callback: Callback) {
- const data = _.get(message, 'data');
- if (_.isUndefined(data)) {
- callback(new Error('No data to sign'), null);
+ const dataIfExists = _.get(message, 'data');
+ if (_.isUndefined(dataIfExists)) {
+ callback(new Error('NO_DATA_TO_SIGN'), null);
}
const privateKeyBuffer = new Buffer(configs.DISPENSER_PRIVATE_KEY as string, 'hex');
- const dataBuff = ethUtil.toBuffer(data);
+ const dataBuff = ethUtil.toBuffer(dataIfExists);
const msgHashBuff = ethUtil.hashPersonalMessage(dataBuff);
const sig = ethUtil.ecsign(msgHashBuff, privateKeyBuffer);
const rpcSig = ethUtil.toRpcSig(sig.v, sig.r, sig.s);