Skip to content

Commit

Permalink
pay_packet_fee
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Oct 14, 2024
1 parent 9c31374 commit 40b36d8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
5 changes: 5 additions & 0 deletions pystarport/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,11 @@ def register_counterparty_payee(
port_id, channel_id, relayer, counterparty_payee, **kwargs
)

def pay_packet_fee(self, port_id, channel_id, packet_seq, i=0, **kwargs):
return self.cosmos_cli(i).pay_packet_fee(
port_id, channel_id, packet_seq, **kwargs
)


def start_cluster(data_dir):
cmd = [
Expand Down
20 changes: 19 additions & 1 deletion pystarport/cosmoscli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1393,7 +1393,7 @@ def ibc_upgrade_channels(self, version, from_addr, **kwargs):
**kwargs,
)
)

def register_counterparty_payee(
self, port_id, channel_id, relayer, counterparty_payee, **kwargs
):
Expand All @@ -1414,3 +1414,21 @@ def register_counterparty_payee(
if rsp["code"] == 0:
rsp = self.event_query_tx_for(rsp["txhash"])
return rsp

def pay_packet_fee(self, port_id, channel_id, packet_seq, **kwargs):
rsp = json.loads(
self.raw(
"tx",
"ibc-fee",
"pay-packet-fee",
port_id,
channel_id,
str(packet_seq),
"-y",
home=self.data_dir,
**kwargs,
)
)
if rsp["code"] == 0:
rsp = self.event_query_tx_for(rsp["txhash"])
return rsp

0 comments on commit 40b36d8

Please sign in to comment.