Skip to content

Fix: Bridge message ID #112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions operate/bridge/providers/native_bridge_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ def find_bridge_finalized_tx(

def get_message_id(
self, from_ledger_api: LedgerApi, bridge_request: BridgeRequest
) -> t.Optional[bytes]:
) -> t.Optional[str]:
"""Get the bridge message id."""
if not bridge_request.execution_data:
return None
Expand Down Expand Up @@ -406,7 +406,9 @@ def get_explorer_link(
message_id = self.get_message_id(from_ledger_api, bridge_request)
if not message_id:
return None
return f"https://bridge.gnosischain.com/bridge-explorer/transaction/0x{message_id.hex()}"
return (
f"https://bridge.gnosischain.com/bridge-explorer/transaction/0x{message_id}"
)


class NativeBridgeProvider(BridgeProvider):
Expand Down
4 changes: 2 additions & 2 deletions operate/data/contracts/foreign_omnibridge/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def get_tokens_bridging_initiated_message_id(
sender: str,
value: int,
raise_on_try: bool = False,
) -> Optional[bytes]:
) -> Optional[str]:
"""Get the 'messageId' for the matching 'TokensBridgingInitiated' within the transaction 'tx_hash'."""
contract_instance = cls.get_instance(
ledger_api=ledger_api, contract_address=contract_address
Expand All @@ -125,6 +125,6 @@ def get_tokens_bridging_initiated_message_id(
and args["sender"].lower() == sender.lower()
and int(args["value"]) == value
):
return args["messageId"]
return args["messageId"].hex()

return None
2 changes: 1 addition & 1 deletion operate/data/contracts/foreign_omnibridge/contract.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ aea_version: '>=1.0.0, <2.0.0'
fingerprint:
__init__.py: bafybeibsmumov3s36vfo24xp2niilcp3ywju2d4yqfadllyjncqtgtndly
build/ForeignOmnibridge.json: bafybeibmcflt7w5p5szgii7glbtrvjahweclowz2k7e6qjq7yfbvszy6em
contract.py: bafybeihywi67spsgsmcbqgjrcqlwgiq2e36ymssznqubfxwedforxek4ri
contract.py: bafybeigty22spq2jejjwpafydhxgmw3tsu7wxuvjefyrkkc2atdbhwn6ku
fingerprint_ignore_patterns: []
contracts: []
class_name: ForeignOmnibridge
Expand Down
4 changes: 2 additions & 2 deletions operate/data/contracts/home_omnibridge/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def find_tokens_bridged_tx(
token: str,
recipient: str,
value: int,
message_id: bytes,
message_id: str,
from_block: BlockIdentifier = "earliest",
to_block: BlockIdentifier = "latest",
) -> Optional[str]:
Expand All @@ -56,7 +56,7 @@ def find_tokens_bridged_tx(
event_signature_hash, # TokensBridged
"0x" + token.lower()[2:].rjust(64, "0"), # token
"0x" + recipient.lower()[2:].rjust(64, "0"), # recipient
"0x" + message_id.hex().rjust(64, "0"), # messageId
"0x" + message_id.rjust(64, "0"), # messageId
]
non_indexed_types = ["uint256"]
non_indexed_values = [
Expand Down
2 changes: 1 addition & 1 deletion operate/data/contracts/home_omnibridge/contract.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ aea_version: '>=1.0.0, <2.0.0'
fingerprint:
__init__.py: bafybeigrlrmwk3dhnoe4o5ovygtmudik7ybhsx2etqqjpvdi65rtlfpuhe
build/HomeOmnibridge.json: bafybeihm4ff4mhoca2iwcogg5srqe2x6p674uxxc3v5dcci4emxfgc7qpm
contract.py: bafybeignqvstktpvbliopzztan4a46crvf3ig5o4yt4fxhjpgljtlyrzga
contract.py: bafybeifukdlnhzey6olh43qjclbf3wpne5dp7xtxxxtvbvfk6roy6vfnie
fingerprint_ignore_patterns: []
contracts: []
class_name: HomeOmnibridge
Expand Down
Loading