Skip to content

Commit

Permalink
added delete and select/list method to keystore
Browse files Browse the repository at this point in the history
  • Loading branch information
monty committed Jun 4, 2024
1 parent c3bc972 commit f400428
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion my_scratch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
8 changes: 3 additions & 5 deletions src/monstr/ident/keystore.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit f400428

Please sign in to comment.