Skip to content

Commit

Permalink
update naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Tburm committed Dec 19, 2024
1 parent 8120ba1 commit badf5ef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion extractors/src/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def clean_data(
):
function_name_snake = camel_to_snake(function_name)
contract_name_snake = camel_to_snake(contract_name)
directory_name = f"{contract_name_snake}_call_{function_name_snake}"
directory_name = f"{contract_name_snake}_function_{function_name_snake}"
input_labels, output_labels = get_labels(contract, function_name)

# fix labels
Expand Down
10 changes: 6 additions & 4 deletions indexers/utils/clickhouse_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def generate_clickhouse_schema(event_name, fields, network_name, protocol_name):
for field_name, field_type in fields:
if field_name == "id":
clickhouse_type = "String"
query.append(f" `param_id` String,")
query.append(" `param_id` String,")
else:
clickhouse_type = map_to_clickhouse_type(field_type)
query.append(f" `{to_snake(field_name)}` {clickhouse_type},")
Expand Down Expand Up @@ -111,7 +111,6 @@ def process_abi_schemas(client, abi, path, contract_name, network_name, protocol
network_name=network_name,
protocol_name=protocol_name,
)
print(schema)
client.command(schema)
save_clickhouse_schema(path=path, event_name=event_name, schema=schema)

Expand All @@ -121,12 +120,15 @@ def process_abi_schemas(client, abi, path, contract_name, network_name, protocol
for f in functions:
function_name = to_snake(f["name"])
contract_name = to_snake(contract_name)
function_name = f"{contract_name}_{function_name}"
function_name = f"{contract_name}_function_{function_name}"

input_types = get_abi_input_types(f)
input_names = get_abi_input_names(f)
output_types = get_abi_output_types(f)
output_names = [o["name"] for o in f["outputs"]]
output_names = [
o["name"] if "name" in o else f"output_{ind}"
for ind, o in enumerate(f["outputs"])
]

all_names = input_names + output_names
all_types = input_types + output_types
Expand Down

0 comments on commit badf5ef

Please sign in to comment.