Skip to content

Commit

Permalink
fix cluster mapping on invalid addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
soad003 committed Jul 19, 2024
1 parent ae691ad commit 5191bf3
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [24.01.7] 2024-07-19
### fixed
- fix cluster mapping errors on invalid addresses. Instead just skip them.

## [24.01.6] 2024-06-20
### fixed
- avoid errors with numpy 2.0 setting version restriction to < 2.0
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SHELL := /bin/bash
PROJECT := tagpack-tool
VENV := .venv
RELEASE := 'v24.01.6'
RELEASE := 'v24.01.7'
# RELEASESEM := 'v1.9.0'

all: format lint test build
Expand Down
1 change: 1 addition & 0 deletions src/tagpack/actorpack.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""ActorPack - A wrapper for ActorPack files"""

import json
import os
import re
Expand Down
1 change: 1 addition & 0 deletions src/tagpack/actorpack_schema.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""ActorPack - A wrappers ActorPack Schema"""

import importlib.resources as pkg_resources

import pandas as pd
Expand Down
1 change: 1 addition & 0 deletions src/tagpack/cmd_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utilities for a more beautiful CMD interface"""

import os


Expand Down
8 changes: 8 additions & 0 deletions src/tagpack/graphsense.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ def get_address_ids(self, df: DataFrame, currency: str) -> DataFrame:
lambda x: eth_address_from_hex(x)
)

# the last step can fail two, eg, wrongly encoded addresses
# so we filter again filter non convertible addresses
df_temp = df_temp[df_temp["address"].notnull()]

elif currency == "ETH":
df_temp["address_prefix"] = df_temp["address"].str[
2 : 2 + ks_config["address_prefix_length"]
Expand All @@ -220,6 +224,10 @@ def get_address_ids(self, df: DataFrame, currency: str) -> DataFrame:
)

df_temp["address"] = df["address"].apply(lambda x: eth_address_from_hex(x))

# the last step can fail two, eg, wrongly encoded addresses
# so we filter again filter non convertible addresses
df_temp = df_temp[df_temp["address"].notnull()]
else:
if "bech_32_prefix" in ks_config:
df_temp["a"] = df_temp["address"].apply(
Expand Down
9 changes: 6 additions & 3 deletions src/tagpack/tagpack.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""TagPack - A wrapper for TagPacks files"""

import glob
import hashlib
import json
Expand Down Expand Up @@ -271,9 +272,11 @@ def get_unique_tags(self):
# check if duplicate entry
t = tuple(
[
str(tag.all_fields.get(k)).lower()
if k in tag.all_fields.keys()
else ""
(
str(tag.all_fields.get(k)).lower()
if k in tag.all_fields.keys()
else ""
)
for k in ["address", "currency", "label", "source"]
]
)
Expand Down
1 change: 1 addition & 0 deletions src/tagpack/tagpack_schema.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""TagPack - A wrappers TagPack Schema"""

import importlib.resources as pkg_resources

import pandas as pd
Expand Down

0 comments on commit 5191bf3

Please sign in to comment.