Skip to content

Commit

Permalink
[Scripted] allow hashing for scripted mode without script
Browse files Browse the repository at this point in the history
  • Loading branch information
techfreaque committed Jan 31, 2023
1 parent d5fe2db commit 8a68d2b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion octobot_tentacles_manager/util/hashing.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,14 @@
def get_tentacles_code_hash(tentacles: list) -> str:
full_code = ""
for linked_tentacle in tentacles:
code_location = linked_tentacle.get_script() if hasattr(linked_tentacle, "get_script") \
code_location = (
linked_tentacle.get_script()
if (
hasattr(linked_tentacle, "get_script")
and linked_tentacle.TRADING_SCRIPT_MODULE
)
else linked_tentacle.__class__
)
full_code = f"{full_code}{inspect.getsource(code_location)}"
return hashlib.sha256(full_code.encode()).hexdigest()

Expand Down

0 comments on commit 8a68d2b

Please sign in to comment.