From 4eaeade618224b675acc690769c5d7d8edcda6ce Mon Sep 17 00:00:00 2001 From: Ivanq Date: Wed, 1 May 2019 07:42:56 +0300 Subject: [PATCH 1/2] Add privToPub and pubToAddr commands --- plugins/CryptMessage/CryptMessagePlugin.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/CryptMessage/CryptMessagePlugin.py b/plugins/CryptMessage/CryptMessagePlugin.py index 7198ed08..462d183c 100644 --- a/plugins/CryptMessage/CryptMessagePlugin.py +++ b/plugins/CryptMessage/CryptMessagePlugin.py @@ -124,6 +124,15 @@ class UiWebsocketPlugin(object): def actionEcdsaVerify(self, to, data, address, signature): self.response(to, CryptBitcoin.verify(data, address, signature)) + # Gets the publickey of a given privatekey + def actionPrivToPub(self, to, privatekey): + self.response(to, btctools.privtopub(privatekey)) + + # Gets the address of a given publickey + def actionPubToAddr(self, to, publickey): + address = btctools.pubtoaddr(btctools.decode_pubkey(publickey)) + self.response(to, address) + @PluginManager.registerTo("User") class UserPlugin(object): From 32051870904843c6d9cf14b8ff94a37139b7c809 Mon Sep 17 00:00:00 2001 From: Ivanq Date: Sun, 19 May 2019 15:52:36 +0300 Subject: [PATCH 2/2] Rename commands to have ecc... prefix --- plugins/CryptMessage/CryptMessagePlugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/CryptMessage/CryptMessagePlugin.py b/plugins/CryptMessage/CryptMessagePlugin.py index 462d183c..9ef2aab1 100644 --- a/plugins/CryptMessage/CryptMessagePlugin.py +++ b/plugins/CryptMessage/CryptMessagePlugin.py @@ -125,11 +125,11 @@ class UiWebsocketPlugin(object): self.response(to, CryptBitcoin.verify(data, address, signature)) # Gets the publickey of a given privatekey - def actionPrivToPub(self, to, privatekey): + def actionEccPrivToPub(self, to, privatekey): self.response(to, btctools.privtopub(privatekey)) # Gets the address of a given publickey - def actionPubToAddr(self, to, publickey): + def actionEccPubToAddr(self, to, publickey): address = btctools.pubtoaddr(btctools.decode_pubkey(publickey)) self.response(to, address)