Skip to content

Commit

Permalink
fix priority
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Jan 2, 2024
1 parent 92c90c5 commit 87f391d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions integration_tests/cosmoscli.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,13 @@ def sign_tx_json(self, tx, signer, max_priority_price=None):
fp.flush()
return self.sign_tx(fp.name, signer)

def broadcast_tx(self, tx_file, **kwargs):
def broadcast_tx(self, tx_file, event_query_tx=True, **kwargs):
kwargs.setdefault("broadcast_mode", "sync")
kwargs.setdefault("output", "json")
rsp = json.loads(
self.raw("tx", "broadcast", tx_file, node=self.node_rpc, **kwargs)
)
if rsp["code"] == 0:
if event_query_tx and rsp["code"] == 0:
rsp = self.event_query_tx_for(rsp["txhash"])
return rsp

Expand All @@ -174,11 +174,11 @@ def event_query_tx_for(self, hash):
)
)

def broadcast_tx_json(self, tx, **kwargs):
def broadcast_tx_json(self, tx, event_query_tx=True, **kwargs):
with tempfile.NamedTemporaryFile("w") as fp:
json.dump(tx, fp)
fp.flush()
return self.broadcast_tx(fp.name, **kwargs)
return self.broadcast_tx(fp.name, event_query_tx, **kwargs)

def tx_search_rpc(self, events: str):
node_rpc_http = "http" + self.node_rpc.removeprefix("tcp")
Expand Down
3 changes: 1 addition & 2 deletions integration_tests/test_priority.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ def test_priority(cluster: ClusterCLI):

txhashes = []
for tx in txs:
rsp = cli.broadcast_tx_json(tx, broadcast_mode="sync")
assert rsp["code"] == 0, rsp["raw_log"]
rsp = cli.broadcast_tx_json(tx, event_query_tx=False)
txhashes.append(rsp["txhash"])

print("wait for two new blocks, so the sent txs are all included")
Expand Down

0 comments on commit 87f391d

Please sign in to comment.