aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-05-02 17:59:49 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-09-17 11:38:26 +0000
commit121c1b94759e39a19979bec4781813381a9a012b (patch)
treea952d95fb5163c3e1cb14cb773a843f37058bdc3
parentfunctional_tests: add tx_notes tests (diff)
downloadmonero-121c1b94759e39a19979bec4781813381a9a012b.tar.xz
functional_tests: check transaction fee is around what we expect
-rwxr-xr-xtests/functional_tests/transfer.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/functional_tests/transfer.py b/tests/functional_tests/transfer.py
index 03050bfbd..cfacd1823 100755
--- a/tests/functional_tests/transfer.py
+++ b/tests/functional_tests/transfer.py
@@ -118,7 +118,7 @@ class TransferTest():
except: ok = True
assert ok
- res = self.wallet[0].transfer([dst], ring_size = 11, payment_id = payment_id, get_tx_key = False)
+ res = self.wallet[0].transfer([dst], ring_size = 11, payment_id = payment_id, get_tx_key = False, get_tx_hex = True)
assert len(res.tx_hash) == 32*2
txid = res.tx_hash
assert len(res.tx_key) == 0
@@ -126,12 +126,19 @@ class TransferTest():
amount = res.amount
assert res.fee > 0
fee = res.fee
- assert len(res.tx_blob) == 0
+ assert len(res.tx_blob) > 0
+ blob_size = len(res.tx_blob) // 2
assert len(res.tx_metadata) == 0
assert len(res.multisig_txset) == 0
assert len(res.unsigned_txset) == 0
unsigned_txset = res.unsigned_txset
+ res = daemon.get_fee_estimate(10)
+ assert res.fee > 0
+ assert res.quantization_mask > 0
+ expected_fee = (res.fee * 1 * blob_size + res.quantization_mask - 1) // res.quantization_mask * res.quantization_mask
+ assert abs(1 - fee / expected_fee) < 0.01
+
self.wallet[0].refresh()
res = daemon.get_info()