diff options
author | Greg Hysen <greg.hysen@gmail.com> | 2019-02-07 09:02:47 +0800 |
---|---|---|
committer | Greg Hysen <greg.hysen@gmail.com> | 2019-02-09 08:25:30 +0800 |
commit | d9c4c74a56c913e90f3c76566c64950fec86063b (patch) | |
tree | 95acb4a0dc54ebe4e371f4ee02d68acf6d080447 /packages/utils | |
parent | 5a231fb0575a00dfcf1237ec4e733cbeb96e984d (diff) | |
download | dexon-0x-contracts-d9c4c74a56c913e90f3c76566c64950fec86063b.tar.gz dexon-0x-contracts-d9c4c74a56c913e90f3c76566c64950fec86063b.tar.zst dexon-0x-contracts-d9c4c74a56c913e90f3c76566c64950fec86063b.zip |
Added tests for ZeroExTransactionDecoder
Diffstat (limited to 'packages/utils')
-rw-r--r-- | packages/utils/src/address_utils.ts | 2 | ||||
-rw-r--r-- | packages/utils/src/transaction_decoder.ts | 8 | ||||
-rw-r--r-- | packages/utils/test/transaction_decoder_test.ts | 5 |
3 files changed, 8 insertions, 7 deletions
diff --git a/packages/utils/src/address_utils.ts b/packages/utils/src/address_utils.ts index 318504c37..b700cd944 100644 --- a/packages/utils/src/address_utils.ts +++ b/packages/utils/src/address_utils.ts @@ -65,5 +65,5 @@ export const addressUtils = { const randomBuff = sha3(randomBigNum.toString()); const randomAddress = `0x${randomBuff.slice(0, 20).toString('hex')}`; return randomAddress; - } + }, }; diff --git a/packages/utils/src/transaction_decoder.ts b/packages/utils/src/transaction_decoder.ts index 2c3b96c72..dd1b4d19a 100644 --- a/packages/utils/src/transaction_decoder.ts +++ b/packages/utils/src/transaction_decoder.ts @@ -30,7 +30,11 @@ export class TransactionDecoder { * @param contractName Name of contract that encapsulates the ABI definitions (optional). * @param deploymentInfos A collection of network/address pairs where this contract is deployed (optional). */ - public addABI(abiDefinitions: AbiDefinition[], contractName?: string, deploymentInfos?: DeployedContractInfo[]): void { + public addABI( + abiDefinitions: AbiDefinition[], + contractName?: string, + deploymentInfos?: DeployedContractInfo[], + ): void { // Disregard definitions that are not functions const functionAbis = _.filter(abiDefinitions, abiEntry => { return abiEntry.type === 'function'; @@ -70,7 +74,7 @@ export class TransactionDecoder { * @return Decoded transaction data. Includes: function name and signature, along with the decoded arguments. */ public decode(txData: string, txProperties_?: TransactionProperties): TransactionData { - // Lookup + // Lookup const functionSelector = TransactionDecoder._getFunctionSelector(txData); const txProperties = _.isUndefined(txProperties_) ? {} : txProperties_; const candidateFunctionInfos = this._functionInfoBySelector[functionSelector]; diff --git a/packages/utils/test/transaction_decoder_test.ts b/packages/utils/test/transaction_decoder_test.ts index f214b1733..bc40f4840 100644 --- a/packages/utils/test/transaction_decoder_test.ts +++ b/packages/utils/test/transaction_decoder_test.ts @@ -1,12 +1,9 @@ import * as chai from 'chai'; import 'mocha'; - import { chaiSetup } from './utils/chai_setup'; chaiSetup.configure(); const expect = chai.expect; -describe.only('TransactionDecoder', () => { - -}); +describe.only('TransactionDecoder', () => {}); |