diff options
author | Alex Browne <stephenalexbrowne@gmail.com> | 2018-11-13 09:36:33 +0800 |
---|---|---|
committer | Alex Browne <stephenalexbrowne@gmail.com> | 2018-12-05 06:24:48 +0800 |
commit | 688d277b30b287f66f0dbd49f2a23cab8b256219 (patch) | |
tree | 97519ff71a2cd9e62c185f04556cd7b4cb6b62d8 /packages/pipeline/src/parsers/web3 | |
parent | 329c68f610843ebded9ca31fc9cd6f3eed744a8e (diff) | |
download | dexon-0x-contracts-688d277b30b287f66f0dbd49f2a23cab8b256219.tar dexon-0x-contracts-688d277b30b287f66f0dbd49f2a23cab8b256219.tar.gz dexon-0x-contracts-688d277b30b287f66f0dbd49f2a23cab8b256219.tar.bz2 dexon-0x-contracts-688d277b30b287f66f0dbd49f2a23cab8b256219.tar.lz dexon-0x-contracts-688d277b30b287f66f0dbd49f2a23cab8b256219.tar.xz dexon-0x-contracts-688d277b30b287f66f0dbd49f2a23cab8b256219.tar.zst dexon-0x-contracts-688d277b30b287f66f0dbd49f2a23cab8b256219.zip |
Configure linter with --format stylish and fix linter errors
Diffstat (limited to 'packages/pipeline/src/parsers/web3')
-rw-r--r-- | packages/pipeline/src/parsers/web3/index.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/packages/pipeline/src/parsers/web3/index.ts b/packages/pipeline/src/parsers/web3/index.ts index 11571278b..2ead4c0e4 100644 --- a/packages/pipeline/src/parsers/web3/index.ts +++ b/packages/pipeline/src/parsers/web3/index.ts @@ -2,6 +2,10 @@ import { BlockWithoutTransactionData, Transaction as EthTransaction } from 'ethe import { Block, Transaction } from '../../entities'; +/** + * Parses a raw block and returns a Block entity. + * @param rawBlock a raw block (e.g. returned from web3-wrapper). + */ export function parseBlock(rawBlock: BlockWithoutTransactionData): Block { if (rawBlock.hash == null) { throw new Error('Tried to parse raw block but hash was null'); @@ -17,6 +21,10 @@ export function parseBlock(rawBlock: BlockWithoutTransactionData): Block { return block; } +/** + * Parses a raw transaction and returns a Transaction entity. + * @param rawBlock a raw transaction (e.g. returned from web3-wrapper). + */ export function parseTransaction(rawTransaction: EthTransaction): Transaction { if (rawTransaction.blockHash == null) { throw new Error('Tried to parse raw transaction but blockHash was null'); |