From f400428e8cd50509d102b34884fc38dbfd3841e8 Mon Sep 17 00:00:00 2001 From: monty Date: Tue, 4 Jun 2024 16:26:56 +0100 Subject: [PATCH] added delete and select/list method to keystore --- my_scratch.py | 2 +- src/monstr/ident/keystore.py | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/my_scratch.py b/my_scratch.py index 5a77972..7a2dfa8 100644 --- a/my_scratch.py +++ b/my_scratch.py @@ -41,7 +41,7 @@ async def get_key() -> str: encrypter=my_enc) # await new_store.add(NamedKeys('moobs')) - await new_store.delete('zoddy') + await new_store.delete('monty') for c_k in await new_store.select(): print(c_k) diff --git a/src/monstr/ident/keystore.py b/src/monstr/ident/keystore.py index e6f81f0..525bafe 100644 --- a/src/monstr/ident/keystore.py +++ b/src/monstr/ident/keystore.py @@ -258,13 +258,11 @@ async def save(self, file_name: str = None): writer = csv.writer(csvfile, delimiter=',') kv: NamedKeys for name in self._store: - k = self._store[name] - kv = k.private_key_bech32() - if kv is None: - kv = k.private_key_bech32() + kv = self._store[name] + k = await self.get_store_key(kv, self._encrypter) writer.writerow([ - k.name, kv + kv.name, k ]) async def load(self, file_name: str = None):