labels plugin: fix it. and extend to cli/daemon.
This commit is contained in:
@@ -5,5 +5,5 @@ description = ' '.join([
|
||||
_("Save your wallet labels on a remote server, and synchronize them across multiple devices where you use Electrum."),
|
||||
_("Labels, transactions IDs and addresses are encrypted before they are sent to the remote server.")
|
||||
])
|
||||
available_for = ['qt', 'kivy']
|
||||
available_for = ['qt', 'kivy', 'cmdline']
|
||||
|
||||
|
||||
11
plugins/labels/cmdline.py
Normal file
11
plugins/labels/cmdline.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from .labels import LabelsPlugin
|
||||
from electrum.plugins import hook
|
||||
|
||||
class Plugin(LabelsPlugin):
|
||||
|
||||
@hook
|
||||
def load_wallet(self, wallet, window):
|
||||
self.start_wallet(wallet)
|
||||
|
||||
def on_pulled(self, wallet):
|
||||
self.print_error('labels pulled from server')
|
||||
@@ -9,6 +9,7 @@ import base64
|
||||
|
||||
import electrum
|
||||
from electrum.plugins import BasePlugin, hook
|
||||
from electrum.crypto import aes_encrypt_with_iv, aes_decrypt_with_iv
|
||||
from electrum.i18n import _
|
||||
|
||||
|
||||
@@ -21,14 +22,14 @@ class LabelsPlugin(BasePlugin):
|
||||
|
||||
def encode(self, wallet, msg):
|
||||
password, iv, wallet_id = self.wallets[wallet]
|
||||
encrypted = electrum.bitcoin.aes_encrypt_with_iv(password, iv,
|
||||
encrypted = aes_encrypt_with_iv(password, iv,
|
||||
msg.encode('utf8'))
|
||||
return base64.b64encode(encrypted).decode()
|
||||
|
||||
def decode(self, wallet, message):
|
||||
password, iv, wallet_id = self.wallets[wallet]
|
||||
decoded = base64.b64decode(message)
|
||||
decrypted = electrum.bitcoin.aes_decrypt_with_iv(password, iv, decoded)
|
||||
decrypted = aes_decrypt_with_iv(password, iv, decoded)
|
||||
return decrypted.decode('utf8')
|
||||
|
||||
def get_nonce(self, wallet):
|
||||
|
||||
Reference in New Issue
Block a user