aboutsummaryrefslogtreecommitdiff
path: root/tests/functional_tests/transfer.py
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-03-25 10:59:46 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-04-11 11:08:09 +0000
commit2d68b31f3e58767c961a790dd51811d69798eac0 (patch)
treed7d840493af53f7803b76e04df2ef06d42ac21fd /tests/functional_tests/transfer.py
parentpython-rpc: add set_log_level and set_log_categories (diff)
downloadmonero-2d68b31f3e58767c961a790dd51811d69798eac0.tar.xz
functional_tests: add more wallet tests
get_transfer_by_txid, get_height, open/close
Diffstat (limited to '')
-rwxr-xr-xtests/functional_tests/transfer.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/functional_tests/transfer.py b/tests/functional_tests/transfer.py
index b7a85f1d6..d0c692157 100755
--- a/tests/functional_tests/transfer.py
+++ b/tests/functional_tests/transfer.py
@@ -62,9 +62,14 @@ class TransferTest():
print("Mining some blocks")
daemon = Daemon()
+ res = daemon.get_info()
+ height = res.height
+
daemon.generateblocks('42ey1afDFnn4886T7196doS9GPMzexD9gXpsZJDwVjeRVdFCSoHnv7KPbBeGpzJBzHRCAs9UxqeoyFQMYbqSWYTfJJQAWDm', 80)
for i in range(len(self.wallet)):
self.wallet[i].refresh()
+ res = self.wallet[i].get_height()
+ assert res.height == height + 80
def transfer(self):
daemon = Daemon()
@@ -169,6 +174,27 @@ class TransferTest():
assert e.double_spend_seen == False
assert e.confirmations == 1
+ res = self.wallet[0].get_height()
+ wallet_height = res.height
+ res = self.wallet[0].get_transfer_by_txid(txid)
+ assert len(res.transfers) == 1
+ assert res.transfers[0] == res.transfer
+ t = res.transfer
+ assert t.txid == txid
+ assert t.payment_id == payment_id
+ assert t.height == wallet_height - 1
+ assert t.timestamp > 0
+ assert t.amount == 0 # to self, so it's just "pay a fee" really
+ assert t.fee == fee
+ assert t.note == ''
+ assert len(t.destinations) == 1
+ assert t.destinations[0] == {'address': '42ey1afDFnn4886T7196doS9GPMzexD9gXpsZJDwVjeRVdFCSoHnv7KPbBeGpzJBzHRCAs9UxqeoyFQMYbqSWYTfJJQAWDm', 'amount': 1000000000000}
+ assert t.type == 'out'
+ assert t.unlock_time == 0
+ assert t.address == '42ey1afDFnn4886T7196doS9GPMzexD9gXpsZJDwVjeRVdFCSoHnv7KPbBeGpzJBzHRCAs9UxqeoyFQMYbqSWYTfJJQAWDm'
+ assert t.double_spend_seen == False
+ assert t.confirmations == 1
+
res = self.wallet[0].get_balance()
assert res.balance == running_balances[0]
assert res.unlocked_balance <= res.balance