-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #333 from planetarium/feature/thor
Apply changes for Thor planet
- Loading branch information
Showing
17 changed files
with
395 additions
and
359 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,7 @@ | ||
import os | ||
|
||
from common.utils.receipt import PlanetID | ||
|
||
|
||
def format_addr(addr: str) -> str: | ||
""" | ||
Check and reformat input address if not starts with `0x`. | ||
""" | ||
if not addr.startswith("0x"): | ||
addr = f"0x{addr}" | ||
return addr.lower() | ||
|
||
|
||
def get_vault_agent_address(planet_id: PlanetID) -> str: | ||
if planet_id == PlanetID.ODIN: | ||
address = os.environ["ODIN_AGENT_ADDRESS"] | ||
elif planet_id == PlanetID.HEIMDALL: | ||
address = os.environ["HEIMDALL_AGENT_ADDRESS"] | ||
elif planet_id == PlanetID.ODIN_INTERNAL: | ||
address = os.environ["ODIN_INTERNAL_AGENT_ADDRESS"] | ||
elif planet_id == PlanetID.HEIMDALL_INTERNAL: | ||
address = os.environ["HEIMDALL_INTERNAL_AGENT_ADDRESS"] | ||
else: | ||
raise ValueError(f"{planet_id!r} is not a value {PlanetID}") | ||
return format_addr(address) | ||
|
||
|
||
def get_vault_avatar_address(planet_id: PlanetID) -> str: | ||
if planet_id == PlanetID.ODIN: | ||
address = os.environ["ODIN_AVATAR_ADDRESS"] | ||
elif planet_id == PlanetID.HEIMDALL: | ||
address = os.environ["HEIMDALL_AVATAR_ADDRESS"] | ||
elif planet_id == PlanetID.ODIN_INTERNAL: | ||
address = os.environ["ODIN_INTERNAL_AVATAR_ADDRESS"] | ||
elif planet_id == PlanetID.HEIMDALL_INTERNAL: | ||
address = os.environ["HEIMDALL_INTERNAL_AVATAR_ADDRESS"] | ||
else: | ||
raise ValueError(f"{planet_id!r} is not a value {PlanetID}") | ||
return format_addr(address) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.