Skip to content
Snippets Groups Projects
Commit 2f4ae091 authored by Holger Nahrstaedt's avatar Holger Nahrstaedt
Browse files

fix unit test for wallet

parent 2b7e7c58
No related branches found
No related tags found
No related merge requests found
...@@ -18,11 +18,6 @@ class ObjectCache(dict): ...@@ -18,11 +18,6 @@ class ObjectCache(dict):
super(ObjectCache, self).__init__(initial_data) super(ObjectCache, self).__init__(initial_data)
self.default_expiration = default_expiration self.default_expiration = default_expiration
def clear(self):
""" Clears the whole cache
"""
dict.__init__(self, dict())
def __setitem__(self, key, value): def __setitem__(self, key, value):
if key in self: if key in self:
del self[key] del self[key]
...@@ -127,8 +122,7 @@ class BlockchainObject(dict): ...@@ -127,8 +122,7 @@ class BlockchainObject(dict):
@staticmethod @staticmethod
def clear_cache(): def clear_cache():
if BlockchainObject._cache: BlockchainObject._cache = ObjectCache()
BlockchainObject._cache.clear()
def test_valid_objectid(self, i): def test_valid_objectid(self, i):
if isinstance(i, string_types): if isinstance(i, string_types):
......
...@@ -293,7 +293,8 @@ class Wallet(object): ...@@ -293,7 +293,8 @@ class Wallet(object):
def addPrivateKey(self, wif): def addPrivateKey(self, wif):
"""Add a private key to the wallet database""" """Add a private key to the wallet database"""
pub = self._get_pub_from_wif(wif) pub = self._get_pub_from_wif(wif)
if isinstance(wif, PrivateKey):
wif = str(wif)
if self.keyStorage: if self.keyStorage:
# Test if wallet exists # Test if wallet exists
if not self.created(): if not self.created():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment