Skip to content
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

Problem: query ibc-transfer denom-trace replaced by denom #144

Merged
merged 1 commit into from
Jan 20, 2025
Merged
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
3 changes: 3 additions & 0 deletions pystarport/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,9 @@ def pay_packet_fee(self, port_id, channel_id, packet_seq, i=0, **kwargs):
def ibc_denom_trace(self, path, node, i=0):
return self.cosmos_cli(i).ibc_denom_trace(path, node)

def ibc_denom(self, path, node, i=0):
return self.cosmos_cli(i).ibc_denom(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 @@ -1449,3 +1449,16 @@ def ibc_denom_trace(self, path, node):
output="json",
)
)["denom_trace"]

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