Skip to content

Commit

Permalink
process only saved credentials during migration (#749)
Browse files Browse the repository at this point in the history
- update migrate command to process only saved credentials
- while migrating keys, skip missing events

Signed-off-by: arshdeep singh <[email protected]>
  • Loading branch information
Arsh-Sandhu authored Apr 9, 2024
1 parent 258726d commit 03367ed
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/keri/app/cli/commands/migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def migrate(tymth, tock=0.0, **opts):
# ksr = stateFromKever(kever)
rgy.states.pin(sad['i'], val=rsr)

for (said,), _ in rgy.creds.getItemIter():
for (said,), _ in rgy.saved.getItemIter():
snkey = dbing.snKey(said, 0)
dig = rgy.getTel(key=snkey)

Expand Down Expand Up @@ -151,7 +151,8 @@ def migrateKeys(db):
for pre, fn, dig in db.getFelItemAllPreIter(key=b''):
dgkey = dbing.dgKey(pre, dig) # get message
if not (raw := db.getEvt(key=dgkey)):
raise kering.MissingEntryError("Missing event for dig={}.".format(dig))
print(f"Migrate keys: missing event for dig={dig}, skipped.")
continue
serder = serdering.SerderKERI(raw=bytes(raw))
val = (coring.Prefixer(qb64b=serder.preb), coring.Seqner(sn=serder.sn))
verfers = serder.verfers or []
Expand Down

0 comments on commit 03367ed

Please sign in to comment.