aboutsummaryrefslogtreecommitdiff
path: root/tests/functional_tests/txpool.py
diff options
context:
space:
mode:
authorj-berman <justinberman@protonmail.com>2022-07-09 15:08:06 -0700
committerj-berman <justinberman@protonmail.com>2022-07-21 11:53:31 -0700
commit8cc3c9af4dde7a32d675c4297d673dee4a9c2514 (patch)
treece08ab68e9425392e8ab869a6f696871beb4a89c /tests/functional_tests/txpool.py
parentMerge pull request #8435 (diff)
downloadmonero-8cc3c9af4dde7a32d675c4297d673dee4a9c2514.tar.xz
Publish submitted txs via zmq
Diffstat (limited to '')
-rwxr-xr-xtests/functional_tests/txpool.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/functional_tests/txpool.py b/tests/functional_tests/txpool.py
index e92b5a530..b7f55d04c 100755
--- a/tests/functional_tests/txpool.py
+++ b/tests/functional_tests/txpool.py
@@ -35,6 +35,7 @@ from __future__ import print_function
from framework.daemon import Daemon
from framework.wallet import Wallet
+from framework.zmq import Zmq
class TransferTest():
def run_test(self):
@@ -105,6 +106,10 @@ class TransferTest():
def check_txpool(self):
daemon = Daemon()
wallet = Wallet()
+ zmq = Zmq()
+
+ zmq_topic = "json-minimal-txpool_add"
+ zmq.sub(zmq_topic)
res = daemon.get_info()
height = res.height
@@ -142,6 +147,21 @@ class TransferTest():
min_bytes = min(min_bytes, x.blob_size)
max_bytes = max(max_bytes, x.blob_size)
+ print('Checking all txs received via zmq')
+ for i in range(len(txes.keys())):
+ zmq_event = zmq.recv(zmq_topic)
+ assert len(zmq_event) == 1
+
+ zmq_tx = zmq_event[0]
+
+ x = [x for x in res.transactions if x.id_hash == zmq_tx["id"]]
+ assert len(x) == 1
+
+ x = x[0]
+ assert x.blob_size == zmq_tx["blob_size"]
+ assert x.weight == zmq_tx["weight"]
+ assert x.fee == zmq_tx["fee"]
+
res = daemon.get_transaction_pool_hashes()
assert sorted(res.tx_hashes) == sorted(txes.keys())