Skip to content

Commit

Permalink
Add baseFeePerGas for block export
Browse files Browse the repository at this point in the history
  • Loading branch information
ninjascant committed Jun 24, 2021
1 parent b568101 commit 4dba6a1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ gas_limit | bigint |
gas_used | bigint |
timestamp | bigint |
transaction_count | bigint |
baseFeePerGas | bigint |

---

Expand Down
1 change: 1 addition & 0 deletions ethereumetl/domain/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ def __init__(self):

self.transactions = []
self.transaction_count = 0
self.baseFeePerGas = 0
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
'gas_limit',
'gas_used',
'timestamp',
'transaction_count'
'transaction_count',
'baseFeePerGas'
]

TRANSACTION_FIELDS_TO_EXPORT = [
Expand Down
2 changes: 2 additions & 0 deletions ethereumetl/mappers/block_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def json_dict_to_block(self, json_dict):
block.gas_limit = hex_to_dec(json_dict.get('gasLimit'))
block.gas_used = hex_to_dec(json_dict.get('gasUsed'))
block.timestamp = hex_to_dec(json_dict.get('timestamp'))
block.baseFeePerGas = hex_to_dec(json_dict.get('baseFeePerGas'))

if 'transactions' in json_dict:
block.transactions = [
Expand Down Expand Up @@ -85,4 +86,5 @@ def block_to_dict(self, block):
'gas_used': block.gas_used,
'timestamp': block.timestamp,
'transaction_count': block.transaction_count,
'baseFeePerGas': block.baseFeePerGas
}

0 comments on commit 4dba6a1

Please sign in to comment.