forked from LBRYCommunity/lbry-sdk
wallet integration test fixes
This commit is contained in:
parent
6039159ecc
commit
2f95c3a9d1
1 changed files with 11 additions and 11 deletions
|
@ -181,7 +181,7 @@ class EpicAdventuresOfChris45(CommandTestCase):
|
|||
|
||||
# Chris45 starts everyday by checking his balance.
|
||||
result = yield self.daemon.jsonrpc_account_balance()
|
||||
self.assertEqual(result, 10)
|
||||
self.assertEqual(result, '10.0')
|
||||
# "10 LBC, yippy! I can do a lot with that.", he thinks to himself,
|
||||
# enthusiastically. But he is hungry so he goes into the kitchen
|
||||
# to make himself a spamdwich.
|
||||
|
@ -204,7 +204,7 @@ class EpicAdventuresOfChris45(CommandTestCase):
|
|||
# Chris doesn't sit idly by: he checks his balance!
|
||||
|
||||
result = yield self.daemon.jsonrpc_account_balance()
|
||||
self.assertEqual(result, 0)
|
||||
self.assertEqual(result, '0.0')
|
||||
|
||||
# "Oh! No! It's all gone? Did I make a mistake in entering the amount?"
|
||||
# exclaims Chris, then he remembers there is a 6 block confirmation window
|
||||
|
@ -214,28 +214,28 @@ class EpicAdventuresOfChris45(CommandTestCase):
|
|||
# To get the unconfirmed balance he has to pass the '--include-unconfirmed'
|
||||
# flag to lbrynet:
|
||||
result = yield self.daemon.jsonrpc_account_balance(include_unconfirmed=True)
|
||||
self.assertEqual(result, Decimal('8.989893'))
|
||||
self.assertEqual(result, '8.989893')
|
||||
# "Well, that's a relief." he thinks to himself as he exhales a sigh of relief.
|
||||
|
||||
# He waits for a block
|
||||
yield self.d_generate(1)
|
||||
# and checks the confirmed balance again.
|
||||
result = yield self.daemon.jsonrpc_account_balance()
|
||||
self.assertEqual(result, 0)
|
||||
self.assertEqual(result, '0.0')
|
||||
# Still zero.
|
||||
|
||||
# But it's only at 2 confirmations, so he waits another 3
|
||||
yield self.d_generate(3)
|
||||
# and checks again.
|
||||
result = yield self.daemon.jsonrpc_account_balance()
|
||||
self.assertEqual(result, 0)
|
||||
self.assertEqual(result, '0.0')
|
||||
# Still zero.
|
||||
|
||||
# Just one more confirmation
|
||||
yield self.d_generate(1)
|
||||
# and it should be 6 total, enough to get the correct balance!
|
||||
result = yield self.daemon.jsonrpc_account_balance()
|
||||
self.assertEqual(result, Decimal('8.989893'))
|
||||
self.assertEqual(result, '8.989893')
|
||||
# Like a Swiss watch (right niko?) the blockchain never disappoints! We're
|
||||
# at 6 confirmations and the total is correct.
|
||||
|
||||
|
@ -266,7 +266,7 @@ class EpicAdventuresOfChris45(CommandTestCase):
|
|||
# He quickly checks the unconfirmed balance to make sure everything looks
|
||||
# correct.
|
||||
result = yield self.daemon.jsonrpc_account_balance(include_unconfirmed=True)
|
||||
self.assertEqual(result, Decimal('7.969786'))
|
||||
self.assertEqual(result, '7.969786')
|
||||
|
||||
# Also checks that his new story can be found on the blockchain before
|
||||
# giving the link to all his friends.
|
||||
|
@ -278,7 +278,7 @@ class EpicAdventuresOfChris45(CommandTestCase):
|
|||
yield self.d_generate(5)
|
||||
# When he comes back he verifies the confirmed balance.
|
||||
result = yield self.daemon.jsonrpc_account_balance()
|
||||
self.assertEqual(result, Decimal('7.969786'))
|
||||
self.assertEqual(result, '7.969786')
|
||||
|
||||
# As people start reading his story they discover some typos and notify
|
||||
# Chris who explains in despair "Oh! Noooooos!" but then remembers
|
||||
|
@ -308,7 +308,7 @@ class EpicAdventuresOfChris45(CommandTestCase):
|
|||
# After abandoning he just waits for his LBCs to be returned to his account
|
||||
yield self.d_generate(5)
|
||||
result = yield self.daemon.jsonrpc_account_balance()
|
||||
self.assertEqual(result, Decimal('8.9693585'))
|
||||
self.assertEqual(result, '8.9693585')
|
||||
|
||||
# Amidst all this Chris receives a call from his friend Ramsey
|
||||
# who says that it is of utmost urgency that Chris transfer him
|
||||
|
@ -325,11 +325,11 @@ class EpicAdventuresOfChris45(CommandTestCase):
|
|||
yield self.d_generate(5)
|
||||
result = yield self.daemon.jsonrpc_account_balance()
|
||||
# Chris' balance was correct
|
||||
self.assertEqual(result, Decimal('7.9692345'))
|
||||
self.assertEqual(result, '7.9692345')
|
||||
|
||||
# Ramsey too assured him that he had received the 1 LBC and thanks him
|
||||
result = yield self.daemon.jsonrpc_account_balance(ramsey_account_id)
|
||||
self.assertEqual(result, Decimal('1.0'))
|
||||
self.assertEqual(result, '1.0')
|
||||
|
||||
# After Chris is done with all the "helping other people" stuff he decides that it's time to
|
||||
# write a new story and publish it to lbry. All he needed was a fresh start and he came up with:
|
||||
|
|
Loading…
Reference in a new issue