Skip to content

Commit

Permalink
feat: new cryo datasets (#4)
Browse files Browse the repository at this point in the history
* update constants with new datasets

align with cryo new datasets, note 4byte_counts alias is suppressed.

* Update utils.py

adds list index to get last two numbers, since erc20 and erc721 mess with it otherwise
  • Loading branch information
matiasandrade authored Dec 29, 2023
1 parent 0c79233 commit 30253ff
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions src/cryogen/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class Dataset(Enum):
blocks = "blocks"
transactions = "transactions"
logs = "logs"
events = "events"
contracts = "contracts"
traces = "traces"
state_diffs = "state_diffs"
Expand All @@ -19,3 +20,28 @@ class Dataset(Enum):
nonce_diffs = "nonce_diffs"
storage_diffs = "storage_diffs"
vm_traces = "vm_traces"
address_appearances = "address_appearances"
balance_reads = "balance_reads"
balances = "balances"
code_reads = "code_reads"
codes = "codes"
erc20_balances = "erc20_balances"
erc20_metadata = "erc20_metadata"
erc20_supplies = "erc20_supplies"
erc20_transfers = "erc20_transfers"
eth_calls = "eth_calls"
four_byte_counts = "four_byte_counts"
geth_calls = "geth_calls"
geth_code_diffs = "geth_code_diffs"
geth_balance_diffs = "geth_balance_diffs"
geth_storage_diffs = "geth_storage_diffs"
geth_nonce_diffs = "geth_nonce_diffs"
geth_opcodes = "geth_opcodes"
javascript_traces = "javascript_traces"
native_transfers = "native_transfers"
nonce_reads = "nonce_reads"
nonces = "nonces"
slots = "slots"
storages = "storages"
trace_calls = "trace_calls"
txs = "txs"
2 changes: 1 addition & 1 deletion src/cryogen/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

def extract_range(file: Path) -> range:
# cryo uses [start, stop], convert to python [start, stop)
start_block, stop_block = re.findall(r"\d+", file.stem)
start_block, stop_block = re.findall(r"\d+", file.stem)[-2:]
return range(int(start_block), int(stop_block) + 1)


Expand Down

0 comments on commit 30253ff

Please sign in to comment.