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

Fix diverse bugs with tx lifecycles

parent c88d876f
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,7 @@ class TransactionsProcessor:
"""
return self._repo.get_transfers(currency, pubkey)
def _try_transition(self, tx, transition_key, inputs):
def _try_transition(self, tx, transition_key, *inputs):
"""
Try the transition defined by the given transition_key
with inputs
......
......@@ -58,10 +58,6 @@ class ContextMenu(QObject):
menu.qmenu.addAction(copy_pubkey)
if identity.uid and menu._app.parameters.expert_mode:
copy_membership = QAction(menu.qmenu.tr("Copy membership document to clipboard"), menu.qmenu.parent())
copy_membership.triggered.connect(lambda checked, i=identity: menu.copy_membership_to_clipboard(i))
menu.qmenu.addAction(copy_membership)
copy_selfcert = QAction(menu.qmenu.tr("Copy self-certification document to clipboard"), menu.qmenu.parent())
copy_selfcert.triggered.connect(lambda checked, i=identity: menu.copy_selfcert_to_clipboard(i))
menu.qmenu.addAction(copy_selfcert)
......@@ -167,23 +163,6 @@ QMessageBox.Ok | QMessageBox.Cancel)
block_doc = await blockchain_processor.get_block(self._connection.currency, number)
clipboard.setText(block_doc.signed_raw())
@asyncify
async def copy_membership_to_clipboard(self, identity):
"""
:param sakia.core.registry.Identity identity:
:return:
"""
clipboard = QApplication.clipboard()
membership = await identity.membership(self._community)
if membership:
block_number = membership['written']
block = await self._community.get_block(block_number)
block_doc = Block.from_signed_raw("{0}{1}\n".format(block['raw'], block['signature']))
for ms_doc in block_doc.joiners:
if ms_doc.issuer == identity.pubkey:
clipboard.setText(ms_doc.signed_raw())
@asyncify
async def copy_selfcert_to_clipboard(self, identity):
"""
......
......@@ -44,10 +44,10 @@ class BlockchainService(QObject):
with_money = await self._blockchain_processor.new_blocks_with_money(self.currency)
blocks = await self._blockchain_processor.blocks(with_identities + with_money + [network_blockstamp.number],
self.currency)
await self._sources_service.refresh_sources()
if len(blocks) > 0:
identities = await self._identities_service.handle_new_blocks(blocks)
changed_tx, new_tx, new_dividends = await self._transactions_service.handle_new_blocks(blocks)
await self._sources_service.refresh_sources()
self._blockchain_processor.handle_new_blocks(self.currency, blocks)
self.app.db.commit()
for tx in changed_tx:
......
......@@ -3,8 +3,7 @@ import attr
import logging
from duniterpy.key import SigningKey
from duniterpy import PROTOCOL_VERSION
from duniterpy.documents import BlockUID, Block, Certification, Membership, Revocation, InputSource, \
from duniterpy.documents import Certification, Membership, Revocation, InputSource, \
OutputSource, SIGParameter, Unlock, block_uid
from duniterpy.documents import Identity as IdentityDoc
from duniterpy.documents import Transaction as TransactionDoc
......@@ -202,7 +201,7 @@ class DocumentsService:
:param str salt: The account SigningKey salt
:param str password: The account SigningKey password
"""
revocation = Revocation(PROTOCOL_VERSION, currency, None)
revocation = Revocation(10, currency, None)
self_cert = identity.document()
key = SigningKey(salt, password)
......
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