diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2017-11-30 14:26:51 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2017-11-30 23:10:18 +0800 |
commit | e85a69655c29a04b7f1a3506c5ecb55433425f7f (patch) | |
tree | d085c0f6fd46980c85f92f60adf95a6b8f272c49 /packages/contracts/util/crypto.ts | |
parent | 4b3e0383235ca4ca0127f24c2e05543bb45a56bb (diff) | |
download | dexon-sol-tools-e85a69655c29a04b7f1a3506c5ecb55433425f7f.tar dexon-sol-tools-e85a69655c29a04b7f1a3506c5ecb55433425f7f.tar.gz dexon-sol-tools-e85a69655c29a04b7f1a3506c5ecb55433425f7f.tar.bz2 dexon-sol-tools-e85a69655c29a04b7f1a3506c5ecb55433425f7f.tar.lz dexon-sol-tools-e85a69655c29a04b7f1a3506c5ecb55433425f7f.tar.xz dexon-sol-tools-e85a69655c29a04b7f1a3506c5ecb55433425f7f.tar.zst dexon-sol-tools-e85a69655c29a04b7f1a3506c5ecb55433425f7f.zip |
Fix indentations
Diffstat (limited to 'packages/contracts/util/crypto.ts')
-rw-r--r-- | packages/contracts/util/crypto.ts | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/packages/contracts/util/crypto.ts b/packages/contracts/util/crypto.ts index e4baee021..5253b8c15 100644 --- a/packages/contracts/util/crypto.ts +++ b/packages/contracts/util/crypto.ts @@ -5,7 +5,7 @@ import ethUtil = require('ethereumjs-util'); import * as _ from 'lodash'; export const crypto = { - /* + /* * We convert types from JS to Solidity as follows: * BigNumber -> uint256 * number -> uint8 @@ -13,26 +13,26 @@ export const crypto = { * boolean -> bool * valid Ethereum address -> address */ - solSHA3(args: any[]): Buffer { - const argTypes: string[] = []; - _.each(args, (arg, i) => { - const isNumber = _.isFinite(arg); - if (isNumber) { - argTypes.push('uint8'); - } else if ((arg).isBigNumber) { - argTypes.push('uint256'); - args[i] = new BN(arg.toString(10), 10); - } else if (ethUtil.isValidAddress(arg)) { - argTypes.push('address'); - } else if (_.isString(arg)) { - argTypes.push('string'); - } else if (_.isBoolean(arg)) { - argTypes.push('bool'); - } else { - throw new Error(`Unable to guess arg type: ${arg}`); - } - }); - const hash = ABI.soliditySHA3(argTypes, args); - return hash; - }, + solSHA3(args: any[]): Buffer { + const argTypes: string[] = []; + _.each(args, (arg, i) => { + const isNumber = _.isFinite(arg); + if (isNumber) { + argTypes.push('uint8'); + } else if ((arg).isBigNumber) { + argTypes.push('uint256'); + args[i] = new BN(arg.toString(10), 10); + } else if (ethUtil.isValidAddress(arg)) { + argTypes.push('address'); + } else if (_.isString(arg)) { + argTypes.push('string'); + } else if (_.isBoolean(arg)) { + argTypes.push('bool'); + } else { + throw new Error(`Unable to guess arg type: ${arg}`); + } + }); + const hash = ABI.soliditySHA3(argTypes, args); + return hash; + }, }; |