1
0

@hook decorator for plugins

This commit is contained in:
ThomasV
2014-08-31 11:42:40 +02:00
parent ee49d14b55
commit a3790372d8
8 changed files with 46 additions and 23 deletions

View File

@@ -12,7 +12,7 @@ from electrum_gui.qt.util import ok_cancel_buttons
from electrum.account import BIP32_Account
from electrum.bitcoin import EncodeBase58Check, DecodeBase58Check, public_key_to_bc_address, bc_address_to_hash_160
from electrum.i18n import _
from electrum.plugins import BasePlugin
from electrum.plugins import BasePlugin, hook
from electrum.transaction import deserialize
from electrum.wallet import NewWallet
@@ -76,12 +76,15 @@ class Plugin(BasePlugin):
def enable(self):
return BasePlugin.enable(self)
@hook
def load_wallet(self, wallet):
self.wallet = wallet
@hook
def add_wallet_types(self, wallet_types):
wallet_types.append(('btchip', _("BTChip wallet"), BTChipWallet))
@hook
def installwizard_restore(self, wizard, storage):
wallet = BTChipWallet(storage)
try:
@@ -91,6 +94,7 @@ class Plugin(BasePlugin):
return
return wallet
@hook
def send_tx(self, tx):
try:
self.wallet.sign_transaction(tx, None, None)