Skip to content

Commit e036774

Browse files
spivachukashcherbakov
authored andcommitted
INDY-830: Wallet migration for rebranding (#402)
Supported wallet migration for rebranding
1 parent 76841bf commit e036774

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

plenum/client/wallet.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,9 @@ class WalletCompatibilityBackend(JSONBackend):
424424
to the current version.
425425
"""
426426

427+
def _getUpToDateClassName(self, pickledClassName):
428+
return pickledClassName.replace('sovrin_client', 'indy_client')
429+
427430
def decode(self, string):
428431
raw = super().decode(string)
429432
# Note that backend.decode may be called not only for the whole object
@@ -434,7 +437,7 @@ def decode(self, string):
434437
# a wallet class supporting backward compatibility
435438
if isinstance(raw, dict) and tags.OBJECT in raw:
436439
clsName = raw[tags.OBJECT]
437-
cls = loadclass(clsName)
440+
cls = loadclass(self._getUpToDateClassName(clsName))
438441
if hasattr(cls, 'makeRawCompatible') \
439442
and callable(getattr(cls, 'makeRawCompatible')):
440443
cls.makeRawCompatible(raw)

0 commit comments

Comments
 (0)