From 047658e68cc41adc0e0b459c4c86f3afa731c7c0 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Thu, 28 Jul 2022 12:11:33 +0800 Subject: [PATCH] add get_ibc_cro_denom --- integration_tests/test_ibc.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/integration_tests/test_ibc.py b/integration_tests/test_ibc.py index 124f313c04..e764b23820 100644 --- a/integration_tests/test_ibc.py +++ b/integration_tests/test_ibc.py @@ -4,6 +4,7 @@ from pathlib import Path from typing import NamedTuple import time +import hashlib import pytest from pystarport import ports @@ -72,6 +73,13 @@ def get_balance(chain, addr, denom): return chain.cosmos_cli().balance(addr, denom) +def get_ibc_cro_denom(channel="channel-0"): + denom_hash = ( + hashlib.sha256(f"transfer/{channel}/basecro".encode()).hexdigest().upper() + ) + return f"ibc/{denom_hash}" + + def test_ibc(ibc): "test sending basecro from crypto-org chain to cronos" # wait for hermes