diff --git a/src/cutecoin/core/account.py b/src/cutecoin/core/account.py index d14e03b659ab45218e97f4f45eb2052637dd826b..3c19370748969ad4c1025930a52d985284e9e4a6 100644 --- a/src/cutecoin/core/account.py +++ b/src/cutecoin/core/account.py @@ -299,7 +299,7 @@ class Account(QObject): error = 0 replies = yield from community.bma_access.broadcast(bma.wot.Add, {}, {'pubkey': self.pubkey, 'self_': selfcert.signed_raw(), - 'other': ""}) + 'other': {}}) except ValueError as e: error += 1 error_msg = str(e) diff --git a/src/cutecoin/tests/gui/process_cfg_community/test_add_community.py b/src/cutecoin/tests/gui/process_cfg_community/test_add_community.py index 784028a773114f9536f487180b8b91a71473231e..9cacc9e260448fa53da3f70d6b275dcc3349044a 100644 --- a/src/cutecoin/tests/gui/process_cfg_community/test_add_community.py +++ b/src/cutecoin/tests/gui/process_cfg_community/test_add_community.py @@ -86,9 +86,10 @@ class ProcessAddCommunity(unittest.TestCase): self.assertEqual(mock.get_request(i).method, 'GET') self.assertEqual(mock.get_request(i).url, '/wot/lookup/7Aqw6Efa9EzE7gtsc8SveLLrM7gm6NEGoywSv4FJx6pZ') + yield from asyncio.sleep(1) - self.assertEqual(mock.get_request(6).method, 'POST') - self.assertEqual(mock.get_request(6).url[:8], '/wot/add') + self.assertEqual(mock.get_request(5).method, 'POST') + self.assertEqual(mock.get_request(5).url[:8], '/wot/add') self.assertEqual(process_community.label_error.text(), "Broadcasting identity...") yield from asyncio.sleep(1) diff --git a/src/cutecoin/tests/gui/transfer/test_transfer.py b/src/cutecoin/tests/gui/transfer/test_transfer.py index ab3e32b9eee3b4078dc281fd56b42161c0c0da60..f3c35f4ff061d4ff80e3af865e1ff3e5a7264bf0 100644 --- a/src/cutecoin/tests/gui/transfer/test_transfer.py +++ b/src/cutecoin/tests/gui/transfer/test_transfer.py @@ -39,7 +39,7 @@ class TestTransferDialog(unittest.TestCase): self.endpoint = BMAEndpoint("", "127.0.0.1", "", 50000) self.node = Node(self.network_manager, "test_currency", [self.endpoint], "", "HnFcSms8jzwngtVomTTnzudZx7SHUQY8sVE1y8yBmULk", - bma.blockchain.Block.null_value, Node.ONLINE, + None, Node.ONLINE, time.time(), {}, "ucoin", "0.14.0", 0) self.network = Network.create(self.network_manager, self.node) self.bma_access = BmaAccess.create(self.network) diff --git a/src/cutecoin/tests/mocks/bma/nice_blockchain.py b/src/cutecoin/tests/mocks/bma/nice_blockchain.py index 76a77edfcc009182df832f6fb04bfc32685b132e..c11b82d5c470ff9a44cebc22055fad870c1a28de 100644 --- a/src/cutecoin/tests/mocks/bma/nice_blockchain.py +++ b/src/cutecoin/tests/mocks/bma/nice_blockchain.py @@ -251,6 +251,13 @@ bma_txsources_john = { } ]} +bma_with_ud = { + "result": + { + "blocks": [] + } +} + def get_mock(): mock = HTTPMock('127.0.0.1', 50000) @@ -266,6 +273,12 @@ def get_mock(): times=FOREVER, headers={'Content-Type': 'application/json'}) + mock.when('GET /blockchain/with/UD')\ + .reply(body=bytes(json.dumps(bma_with_ud), "utf-8"), + status=200, + times=FOREVER, + headers={'Content-Type': 'application/json'}) + mock.when('GET /blockchain/current')\ .reply(body=bytes(json.dumps(bma_blockchain_current), "utf-8"), status=200, diff --git a/src/cutecoin/tests/stubs/core/registry/identity.py b/src/cutecoin/tests/stubs/core/registry/identity.py index a6da4340d96552170532cf7b52fd356997e6a87f..9c3faee1db54e537a7444f72f4e74db71b6255c9 100644 --- a/src/cutecoin/tests/stubs/core/registry/identity.py +++ b/src/cutecoin/tests/stubs/core/registry/identity.py @@ -12,7 +12,7 @@ from ucoinpy.documents.certification import SelfCertification from cutecoin.tools.exceptions import Error, NoPeerAvailable,\ MembershipNotFoundError from ucoinpy.api import bma -from cutecoin.core.net.api.bma import PROTOCOL_VERSION +from ucoinpy.api.bma import PROTOCOL_VERSION from PyQt5.QtCore import QObject, pyqtSignal