Esempio n. 1
0
    def setUp(self):
        self.setUpQuamash()
        QLocale.setDefault(QLocale("en_GB"))
        self.identities_registry = IdentitiesRegistry({})

        self.application = Application(self.qapplication, self.lp, self.identities_registry)
        self.application.preferences['notifications'] = False

        self.endpoint = BMAEndpoint("", "127.0.0.1", "", 50005)
        self.node = Node("test_currency", [self.endpoint],
                         "", "HnFcSms8jzwngtVomTTnzudZx7SHUQY8sVE1y8yBmULk",
                         nice_blockchain.bma_blockchain_current, Node.ONLINE,
                         time.time(), {}, "duniter", "0.14.0", 0)
        self.network = Network.create(self.node)
        self.bma_access = BmaAccess.create(self.network)
        self.community = Community("test_currency", self.network, self.bma_access)

        self.wallet = Wallet(0, "7Aqw6Efa9EzE7gtsc8SveLLrM7gm6NEGoywSv4FJx6pZ",
                             "Wallet 1", self.identities_registry)
        self.wallet.init_cache(self.application, self.community)

        # Salt/password : "******"
        # Pubkey : 7Aqw6Efa9EzE7gtsc8SveLLrM7gm6NEGoywSv4FJx6pZ
        self.account = Account("testsakia", "7Aqw6Efa9EzE7gtsc8SveLLrM7gm6NEGoywSv4FJx6pZ",
                               "john", [self.community], [self.wallet], [], self.identities_registry)
Esempio n. 2
0
    def setUp(self):
        self.setUpQuamash()
        QLocale.setDefault(QLocale("en_GB"))

        self.application = Application(self.qapplication, self.lp,
                                       IdentitiesRegistry())
        self.main_window = MainWindow.startup(self.application)
Esempio n. 3
0
    def setUp(self):
        self.setUpQuamash()
        QLocale.setDefault(QLocale("en_GB"))
        self.identities_registry = IdentitiesRegistry()

        self.application = Application(self.qapplication, self.lp,
                                       self.identities_registry)
        self.application.preferences['notifications'] = False

        self.peer = Peer.from_signed_raw("""Version: 2
Type: Peer
Currency: meta_brouzouf
PublicKey: 8Fi1VSTbjkXguwThF4v2ZxC5whK7pwG2vcGTkPUPjPGU
Block: 48698-000005E0F228038E4DDD4F6CA4ACB01EC88FBAF8
Endpoints:
BASIC_MERKLED_API duniter.inso.ovh 80
82o1sNCh1bLpUXU6nacbK48HBcA9Eu2sPkL1/3c2GtDPxBUZd2U2sb7DxwJ54n6ce9G0Oy7nd1hCxN3fS0oADw==
""")
        self.node = Node(self.peer, "",
                         "HnFcSms8jzwngtVomTTnzudZx7SHUQY8sVE1y8yBmULk", None,
                         Node.ONLINE, time.time(), {}, "duniter", "0.12.0", 0,
                         Mock("aiohttp.ClientSession"))
        self.network = Network.create(self.node)
        self.bma_access = BmaAccess.create(self.network)
        self.community = Community("test_currency", self.network,
                                   self.bma_access)
Esempio n. 4
0
    def test_identity_from_handled_data(self):
        community = mock.MagicMock()
        type(community).currency = mock.PropertyMock(return_value="test_currency")

        identity = Identity("john", "7Aqw6Efa9EzE7gtsc8SveLLrM7gm6NEGoywSv4FJx6pZ", None,
                            LocalState.COMPLETED, BlockchainState.VALIDATED)
        test_instances = {
            "test_currency": {"7Aqw6Efa9EzE7gtsc8SveLLrM7gm6NEGoywSv4FJx6pZ": identity}
        }
        identities_registry = IdentitiesRegistry(test_instances)

        identity_from_data = identities_registry.from_handled_data("john",
                                                                    "7Aqw6Efa9EzE7gtsc8SveLLrM7gm6NEGoywSv4FJx6pZ",
                                                                   None,
                                                                   BlockchainState.VALIDATED,
                                                                   community)
        self.assertEqual(identity, identity_from_data)
Esempio n. 5
0
    def setUp(self):
        self.setUpQuamash()
        QLocale.setDefault(QLocale("en_GB"))
        self.identities_registry = IdentitiesRegistry({})

        self.application = Application(self.qapplication, self.lp, self.identities_registry)
        self.application.preferences['notifications'] = False
        # Salt/password : "******"
        # Pubkey : 7Aqw6Efa9EzE7gtsc8SveLLrM7gm6NEGoywSv4FJx6pZ
        self.account = Account("testsakia", "7Aqw6Efa9EzE7gtsc8SveLLrM7gm6NEGoywSv4FJx6pZ",
                               "john", [], [], [], self.identities_registry)
        self.password_asker = PasswordAskerDialog(self.account)
        self.password_asker.password = "******"
        self.password_asker.remember = True
Esempio n. 6
0
    def setUp(self):
        self.setUpQuamash()
        QLocale.setDefault(QLocale("en_GB"))
        self.identities_registry = IdentitiesRegistry({})

        self.application = Application(self.qapplication, self.lp,
                                       self.identities_registry)
        self.application.preferences['notifications'] = False

        self.mock_new_community = init_new_community.get_mock(self.lp)

        self.endpoint = BMAEndpoint("", "127.0.0.1", "", 50010)
        self.node = Node(self.mock_new_community.peer(),
                         "",
                         "HnFcSms8jzwngtVomTTnzudZx7SHUQY8sVE1y8yBmULk",
                         None,
                         Node.ONLINE,
                         time.time(), {},
                         "duniter",
                         "0.14.0",
                         0,
                         session=aiohttp.ClientSession())
        self.network = Network.create(self.node)
        self.bma_access = BmaAccess.create(self.network)
        self.community = Community("test_currency", self.network,
                                   self.bma_access)

        self.wallet = Wallet(0, "7Aqw6Efa9EzE7gtsc8SveLLrM7gm6NEGoywSv4FJx6pZ",
                             "Wallet 1", self.identities_registry)

        # Salt/password : "******"
        # Pubkey : 7Aqw6Efa9EzE7gtsc8SveLLrM7gm6NEGoywSv4FJx6pZ
        self.account = Account("testsakia",
                               "7Aqw6Efa9EzE7gtsc8SveLLrM7gm6NEGoywSv4FJx6pZ",
                               "john", [self.community], [self.wallet], [],
                               self.identities_registry)
        self.account.notifications['warning_certifying_first_time'] = False
        self.password_asker = PasswordAskerDialog(self.account)
        self.password_asker.password = "******"
        self.password_asker.remember = True
Esempio n. 7
0
 def setUp(self):
     self.setUpQuamash()
     QLocale.setDefault(QLocale("en_GB"))
     self.identities_registry = IdentitiesRegistry()