Skip to content

Commit

Permalink
fixing script
Browse files Browse the repository at this point in the history
  • Loading branch information
tutugordillo committed Jan 6, 2025
1 parent b49f1e7 commit 9ba3d08
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions scripts/replace_bytecode_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ def update_bytecode(json_file_path, contract_name, new_bytecode):
:param contract_name: Nombre del contrato cuyo bytecode se va a sustituir.
:param new_bytecode: Nuevo valor para la clave 'bytecode'.
"""

for c in json_file_path:

json_contract = json_file_path[c]

if contract_name.startswith(json_contract["contract"]):
# Verificar si 'bytecode' está en el JSON
if contract_name.startswith(json_contract["contract"].strip(":")):
# Verificar si 'bytecode' está en el JSON
json_contract["bytecode"] = new_bytecode

def get_evm_code(log_file):
Expand Down Expand Up @@ -45,9 +46,8 @@ def get_evm_code(log_file):

evm_codes = get_evm_code(log_file)

path_to_test = test_file.split("/")[:-2]
path_to_test = test_file.split("/")[:-1]

print(path_to_test)
result_file = "/".join(path_to_test)+"/test_grey"


Expand All @@ -58,10 +58,11 @@ def get_evm_code(log_file):

for c in evm_codes:
evm = evm_codes[c]
update_bytecode(data, c, evm)

update_bytecode(data, c.strip(), evm.strip())

# Guardar el archivo JSON actualizado

with open(result_file, 'w') as file:
json.dump(data, file, indent=4)

Expand Down

0 comments on commit 9ba3d08

Please sign in to comment.