Skip to content

Commit

Permalink
fix: use cesrnumber when parsing sn in rotate event
Browse files Browse the repository at this point in the history
  • Loading branch information
lenkan committed May 2, 2024
1 parent fddaff2 commit 404c377
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/keri/core/eventing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ export function rotate({
throw new Error(`Invalid ilk = ${ilk} for rot or drt.`);
}

const sner = Number(sn);
if (sner < 1) {
throw new Error(`Invalid sn = 0x${sner.toString()} for rot or drt.`);
const sner = new CesrNumber({}, sn);
if (sner.num < 1) {
throw new Error(`Invalid sn = 0x${sner.numh} for rot or drt.`);
}
let _isit: number;

Expand Down Expand Up @@ -199,7 +199,7 @@ export function rotate({
t: _ilk,
d: '',
i: pre,
s: sner.toString(16),
s: sner.numh,
p: dig,
kt:
tholder.num &&
Expand Down

0 comments on commit 404c377

Please sign in to comment.