Skip to content

Commit

Permalink
Merge pull request #615 from SmithSamuelM/serder
Browse files Browse the repository at this point in the history
fixed bug in Serder logic for non-saidive message like receipts rct
  • Loading branch information
SmithSamuelM authored Dec 1, 2023
2 parents bb03457 + 086bc0d commit f2f434d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/keri/core/serdering.py
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,8 @@ def said(self):
Returns:
said (str): qb64
"""
if not self.Fields[self.proto][self.vrsn][self.ilk].saids.keys() and 'd' in self._sad:
return self._sad['d'] # special case for non-saidive messages like rct
return self._said


Expand All @@ -1064,7 +1066,7 @@ def saidb(self):
Returns:
saidb (bytes): qb64b of said of .saider
"""
return self._said.encode("utf-8") if self._said is not None else None
return self.said.encode("utf-8") if self.said is not None else None


@property
Expand Down
4 changes: 3 additions & 1 deletion tests/core/test_serdering.py
Original file line number Diff line number Diff line change
Expand Up @@ -1580,7 +1580,9 @@ def test_serderkeri_rct():

assert not serder.verify() # because pre is empty
assert serder.ilk == kering.Ilks.rct
assert serder.pre == '' != serder.said # prefix is not saidive
assert serder._said == None # no saidive fields
assert serder.pre == '' # prefix is not saidive
assert serder.said == '' # d field is not saidive

sad = serder.sad

Expand Down

0 comments on commit f2f434d

Please sign in to comment.