Skip to content

Commit

Permalink
ibc_denom_trace
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Oct 14, 2024
1 parent 40b36d8 commit 0749d7e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pystarport/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,9 @@ def pay_packet_fee(self, port_id, channel_id, packet_seq, i=0, **kwargs):
port_id, channel_id, packet_seq, **kwargs
)

def ibc_denom_trace(self, path, node, i=0):
return self.cosmos_cli(i).ibc_denom_trace(path, node)


def start_cluster(data_dir):
cmd = [
Expand Down
13 changes: 13 additions & 0 deletions pystarport/cosmoscli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1432,3 +1432,16 @@ def pay_packet_fee(self, port_id, channel_id, packet_seq, **kwargs):
if rsp["code"] == 0:
rsp = self.event_query_tx_for(rsp["txhash"])
return rsp

def ibc_denom_trace(self, path, node):
denom_hash = hashlib.sha256(path.encode()).hexdigest().upper()
return json.loads(
self.raw(
"q",
"ibc-transfer",
"denom-trace",
denom_hash,
node=node,
output="json",
)
)["denom_trace"]

0 comments on commit 0749d7e

Please sign in to comment.