From 404c3776cfdb896c4425a181d47a09eac207359d Mon Sep 17 00:00:00 2001 From: lenkan Date: Thu, 2 May 2024 18:34:37 +0200 Subject: [PATCH] fix: use cesrnumber when parsing sn in rotate event --- src/keri/core/eventing.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/keri/core/eventing.ts b/src/keri/core/eventing.ts index d03e4473..3130b159 100644 --- a/src/keri/core/eventing.ts +++ b/src/keri/core/eventing.ts @@ -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; @@ -199,7 +199,7 @@ export function rotate({ t: _ilk, d: '', i: pre, - s: sner.toString(16), + s: sner.numh, p: dig, kt: tholder.num &&