Skip to content

Commit

Permalink
started tests support for Seals in CESR native keri event messages
Browse files Browse the repository at this point in the history
  • Loading branch information
SmithSamuelM committed Apr 10, 2024
1 parent b8871fa commit 90a1671
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
25 changes: 18 additions & 7 deletions src/keri/core/serdering.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,22 @@
MAXVERFULLSPAN, VER1FULLSPAN, VER2FULLSPAN)
from ..kering import SMELLSIZE, Smellage, smell

from ..kering import Protocols, Serials, Rever, versify, deversify, Ilks
from ..core import coring
from ..kering import Protocols, Serials, versify, deversify, Ilks

from .. import help
from ..help import helping


from . import coring
from .coring import MtrDex, DigDex, PreDex, Saids, Digestage
from .coring import (Matter, Saider, Verfer, Diger, Number, Tholder, Tagger,
Ilker, Traitor, Verser, )

from ..core import counting
from ..core.counting import GenDex, AllTags, Counter
from .counting import GenDex, AllTags, Counter

from .structing import Sealer


from .. import help
from ..help import helping
from ..help.helping import nonStringSequence

logger = help.ogler.getLogger()

Expand Down Expand Up @@ -1280,6 +1284,13 @@ def _dumps(self, sad):
case "a": # list of seals or field map of attributes
frame = bytearray()
for e in v: # list of seal dicts
try:
sealer = Sealer(crew=e)
frame.extend(sealer.qb64b)
except kering.InvalidValueError:
pass
#unknown seal type so serialize as field map

pass
#if tuple(v) == eventing.SealEvent._fields:
#eseal = eventing.SealEvent(**v) # convert to namedtuple
Expand Down
1 change: 1 addition & 0 deletions tests/core/test_serdering.py
Original file line number Diff line number Diff line change
Expand Up @@ -2649,6 +2649,7 @@ def test_cesr_native_dumps():
raw = b'\x05\xaa\x8f-S\x9a\xe9\xfaU\x9c\x02\x9c\x9b\x08Hu'
salter = core.Salter(raw=raw)

# replace with Salter.signers()
csigners = core.generateSigners(raw=salter.raw, count=3)
wsigners = core.generateSigners(raw=salter.raw, count=3, transferable=False)

Expand Down

0 comments on commit 90a1671

Please sign in to comment.