Skip to content
Snippets Groups Projects
Commit 70dab8d4 authored by inso's avatar inso
Browse files

Fix test wallet

parent d15899b9
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,7 @@ import pypeg2 ...@@ -3,6 +3,7 @@ import pypeg2
from unittest.mock import MagicMock, PropertyMock from unittest.mock import MagicMock, PropertyMock
from asynctest import CoroutineMock from asynctest import CoroutineMock
from duniterpy.grammars import output from duniterpy.grammars import output
from duniterpy.documents import BlockUID
from PyQt5.QtCore import QLocale from PyQt5.QtCore import QLocale
from sakia.core.registry.identities import IdentitiesRegistry from sakia.core.registry.identities import IdentitiesRegistry
from sakia.core import Wallet from sakia.core import Wallet
...@@ -61,7 +62,10 @@ class TestWallet(unittest.TestCase, QuamashTest): ...@@ -61,7 +62,10 @@ class TestWallet(unittest.TestCase, QuamashTest):
"Wallet 1", self.identities_registry) "Wallet 1", self.identities_registry)
wallet.caches["test_currency"] = cache wallet.caches["test_currency"] = cache
tx = wallet.prepare_tx("FADxcH5LmXGmGFgdixSes6nWnC4Vb4pRUBYT81zQRhjn", tx = wallet.prepare_tx("FADxcH5LmXGmGFgdixSes6nWnC4Vb4pRUBYT81zQRhjn",
BlockUID(32, "000005E0F228038E4DDD4F6CA4ACB01EC88FBAF8"),
99, "", community) 99, "", community)
self.assertEqual(tx.blockstamp.number, 32)
self.assertEqual(tx.blockstamp.sha_hash, "000005E0F228038E4DDD4F6CA4ACB01EC88FBAF8")
self.assertEqual(len(tx.issuers), 1) self.assertEqual(len(tx.issuers), 1)
self.assertEqual(tx.issuers[0], "7Aqw6Efa9EzE7gtsc8SveLLrM7gm6NEGoywSv4FJx6pZ") self.assertEqual(tx.issuers[0], "7Aqw6Efa9EzE7gtsc8SveLLrM7gm6NEGoywSv4FJx6pZ")
self.assertEqual(len(tx.inputs), 2) self.assertEqual(len(tx.inputs), 2)
...@@ -134,7 +138,10 @@ Comment:""" + " \n") ...@@ -134,7 +138,10 @@ Comment:""" + " \n")
"Wallet 1", self.identities_registry) "Wallet 1", self.identities_registry)
wallet.caches["test_currency"] = cache wallet.caches["test_currency"] = cache
tx = wallet.prepare_tx("FADxcH5LmXGmGFgdixSes6nWnC4Vb4pRUBYT81zQRhjn", tx = wallet.prepare_tx("FADxcH5LmXGmGFgdixSes6nWnC4Vb4pRUBYT81zQRhjn",
BlockUID(32, "000005E0F228038E4DDD4F6CA4ACB01EC88FBAF8"),
100, "", community) 100, "", community)
self.assertEqual(tx.blockstamp.number, 32)
self.assertEqual(tx.blockstamp.sha_hash, "000005E0F228038E4DDD4F6CA4ACB01EC88FBAF8")
self.assertEqual(len(tx.issuers), 1) self.assertEqual(len(tx.issuers), 1)
self.assertEqual(tx.issuers[0], "7Aqw6Efa9EzE7gtsc8SveLLrM7gm6NEGoywSv4FJx6pZ") self.assertEqual(tx.issuers[0], "7Aqw6Efa9EzE7gtsc8SveLLrM7gm6NEGoywSv4FJx6pZ")
self.assertEqual(len(tx.inputs), 1) self.assertEqual(len(tx.inputs), 1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment