From 87f391db57de7902ce3704a29c665ac0af7ecd8b Mon Sep 17 00:00:00 2001 From: mmsqe Date: Tue, 2 Jan 2024 13:54:27 +0800 Subject: [PATCH] fix priority --- integration_tests/cosmoscli.py | 8 ++++---- integration_tests/test_priority.py | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/integration_tests/cosmoscli.py b/integration_tests/cosmoscli.py index 48828133e..b03bfca4f 100644 --- a/integration_tests/cosmoscli.py +++ b/integration_tests/cosmoscli.py @@ -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 @@ -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") diff --git a/integration_tests/test_priority.py b/integration_tests/test_priority.py index 24820fac5..57012258e 100644 --- a/integration_tests/test_priority.py +++ b/integration_tests/test_priority.py @@ -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")