Skip to content

Commit 7fc55b3

Browse files
committed
hww: add a deprecation message popup at get_xpub time for bitbox01 and safe-t
1 parent bc37f9c commit 7fc55b3

2 files changed

Lines changed: 30 additions & 10 deletions

File tree

electrum/plugins/digitalbitbox/digitalbitbox.py

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -125,18 +125,28 @@ def get_xpub(self, bip32_path, xtype):
125125
raise UserFacingException(_('This device does not reveal xpubs corresponding to non-hardened paths'))
126126

127127
reply = self._get_xpub(bip32_path)
128-
if reply:
129-
xpub = reply['xpub']
130-
# Change type of xpub to the requested type. The firmware
131-
# only ever returns the mainnet standard type, but it is agnostic
132-
# to the type when signing.
133-
if xtype != 'standard' or constants.net.TESTNET:
134-
node = BIP32Node.from_xkey(xpub, net=constants.BitcoinMainnet)
135-
xpub = node._replace(xtype=xtype).to_xpub()
136-
return xpub
137-
else:
128+
if not reply:
138129
raise Exception('no reply')
139130

131+
xpub = reply['xpub']
132+
# Change type of xpub to the requested type. The firmware
133+
# only ever returns the mainnet standard type, but it is agnostic
134+
# to the type when signing.
135+
if xtype != 'standard' or constants.net.TESTNET:
136+
node = BIP32Node.from_xkey(xpub, net=constants.BitcoinMainnet)
137+
xpub = node._replace(xtype=xtype).to_xpub()
138+
139+
deprecation_warning = (
140+
"DigitalBitbox (BitBox01) is being deprecated.\n\nIt is no longer supported by the manufacturer.\n"
141+
"Future versions of Electrum will no longer be compatible with it.\n\n"
142+
"You should move your coins and migrate to a modern hardware device.")
143+
_logger.warning(deprecation_warning.replace("\n", " "))
144+
145+
if self.handler:
146+
self.handler.show_message(deprecation_warning)
147+
148+
return xpub
149+
140150
def get_soft_device_id(self):
141151
return None
142152

electrum/plugins/safe_t/clientbase.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,16 @@ def get_xpub(self, bip32_path, xtype):
175175
address_n = self.expand_path(bip32_path)
176176
creating = False
177177
node = self.get_public_node(address_n, creating).node
178+
179+
deprecation_warning = (
180+
"Archos Safe-T mini is being deprecated.\n\nIt is no longer supported by the manufacturer.\n"
181+
"Future versions of Electrum will no longer be compatible with it.\n\n"
182+
"You should move your coins and migrate to a modern hardware device.")
183+
self.logger.warning(deprecation_warning.replace("\n", " "))
184+
185+
if self.handler:
186+
self.handler.show_message(deprecation_warning)
187+
178188
return BIP32Node(xtype=xtype,
179189
eckey=ecc.ECPubkey(node.public_key),
180190
chaincode=node.chain_code,

0 commit comments

Comments
 (0)