aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/src/parsers/web3
diff options
context:
space:
mode:
authorAlex Browne <stephenalexbrowne@gmail.com>2018-11-13 09:36:33 +0800
committerFred Carlsen <fred@sjelfull.no>2018-12-06 19:04:25 +0800
commitb818a62d745b2e91a8808ded9bac279d2dbf8a7e (patch)
treeda2a095d1ee14ea7e1226de8911a5c323229be07 /packages/pipeline/src/parsers/web3
parente69cdfb7b5b0b4c7517d5439d45888702c6a1b71 (diff)
downloaddexon-sol-tools-b818a62d745b2e91a8808ded9bac279d2dbf8a7e.tar
dexon-sol-tools-b818a62d745b2e91a8808ded9bac279d2dbf8a7e.tar.gz
dexon-sol-tools-b818a62d745b2e91a8808ded9bac279d2dbf8a7e.tar.bz2
dexon-sol-tools-b818a62d745b2e91a8808ded9bac279d2dbf8a7e.tar.lz
dexon-sol-tools-b818a62d745b2e91a8808ded9bac279d2dbf8a7e.tar.xz
dexon-sol-tools-b818a62d745b2e91a8808ded9bac279d2dbf8a7e.tar.zst
dexon-sol-tools-b818a62d745b2e91a8808ded9bac279d2dbf8a7e.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.ts8
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');