Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Serials to Kinds to match keripy #275

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/keria/app/indirecting.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from keri.app import httping
from keri.core import eventing
from keri.core.coring import Ilks, Sadder
from keri.kering import Protocols
from keri.kering import Protocols, Kinds

CESR_DESTINATION_HEADER = "CESR-DESTINATION"

Expand Down Expand Up @@ -78,7 +78,7 @@ def on_post(self, req, rep):
rep.set_header('connection', "close")

cr = httping.parseCesrHttpRequest(req=req)
serder = Sadder(ked=cr.payload, kind=eventing.Serials.json)
serder = Sadder(ked=cr.payload, kind=Kinds.json)
msg = bytearray(serder.raw)
msg.extend(cr.attachments.encode("utf-8"))

Expand Down
10 changes: 5 additions & 5 deletions src/keria/testing/testing_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,9 @@ def inceptRandy(bran, count=1, sith="1", wits=None, toad="0"):

creator = keeping.RandyCreator()
signers = creator.create(count=count)
prxs = [encrypter.encrypt(matter=signer).qb64 for signer in signers]
prxs = [encrypter.encrypt(prim=signer).qb64 for signer in signers]
nsigners = creator.create(count=count)
nxts = [encrypter.encrypt(matter=signer).qb64 for signer in nsigners]
nxts = [encrypter.encrypt(prim=signer).qb64 for signer in nsigners]

keys = [signer.verfer.qb64 for signer in signers]
ndigs = [coring.Diger(ser=nsigner.verfer.qb64b) for nsigner in nsigners]
Expand Down Expand Up @@ -422,13 +422,13 @@ def interact(pre, bran, pidx, ridx, sn, dig, data):
signers = creator.create(pidx=pidx, ridx=ridx, tier=coring.Tiers.low, temp=False, count=1)
sigers = [signer.sign(ser=serder.raw, index=0).qb64 for signer in signers]
return serder, sigers

@staticmethod
def createRotate(aid, salt, signers, pidx, ridx, kidx, wits, toad):
salter = core.Salter(raw=salt)
creator = keeping.SaltyCreator(salt=salter.qb64, stem="signify:aid", tier=coring.Tiers.low)
encrypter = core.Encrypter(verkey=signers[0].verfer.qb64)
sxlt = encrypter.encrypt(salter.qb64).qb64
sxlt = encrypter.encrypt(ser=salter.qb64).qb64

rsigners = creator.create(pidx=pidx, ridx=ridx, tier=coring.Tiers.low, temp=False, count=1)
rnsigners = creator.create(pidx=pidx, ridx=ridx+1, tier=coring.Tiers.low, temp=False, count=1)
Expand Down Expand Up @@ -468,7 +468,7 @@ def createAid(client, name, salt, wits=None, toad="0", delpre=None):

salter = core.Salter(raw=salt)
encrypter = core.Encrypter(verkey=signers[0].verfer.qb64)
sxlt = encrypter.encrypt(salter.qb64).qb64
sxlt = encrypter.encrypt(ser=salter.qb64).qb64

sigers = [signer.sign(ser=serder.raw, index=0).qb64 for signer in signers]

Expand Down
18 changes: 9 additions & 9 deletions tests/app/test_aiding.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def test_identifier_collection_end(helpers):

salter = core.Salter(raw=salt)
encrypter = core.Encrypter(verkey=signers[0].verfer.qb64)
sxlt = encrypter.encrypt(salter.qb64).qb64
sxlt = encrypter.encrypt(ser=salter.qb64).qb64

body = {'name': 'aid1',
'icp': serder.ked,
Expand Down Expand Up @@ -782,8 +782,8 @@ def test_identifier_collection_end(helpers):
ndigs=[diger.qb64 for diger in ndigs])

sigers = [signer.sign(ser=serder.raw, index=0).qb64 for signer in signers]
prxs = [encrypter.encrypt(matter=signer).qb64 for signer in signers]
nxts = [encrypter.encrypt(matter=signer).qb64 for signer in nsigners]
prxs = [encrypter.encrypt(prim=signer).qb64 for signer in signers]
nxts = [encrypter.encrypt(prim=signer).qb64 for signer in nsigners]

body = {'rot': serder.ked,
'sigs': sigers,
Expand Down Expand Up @@ -872,8 +872,8 @@ def test_identifier_collection_end(helpers):
)

sigers = [signer.sign(ser=serder.raw, index=0).qb64 for signer in signers]
prxs = [encrypter.encrypt(matter=signer).qb64 for signer in signers]
nxts = [encrypter.encrypt(matter=signer).qb64 for signer in nsigners]
prxs = [encrypter.encrypt(prim=signer).qb64 for signer in signers]
nxts = [encrypter.encrypt(prim=signer).qb64 for signer in nsigners]

body = {'rot': serder.ked,
'sigs': sigers,
Expand Down Expand Up @@ -913,7 +913,7 @@ def test_identifier_collection_end(helpers):

salter = core.Salter(raw=salt)
encrypter = core.Encrypter(verkey=signers[0].verfer.qb64)
sxlt = encrypter.encrypt(salter.qb64).qb64
sxlt = encrypter.encrypt(ser=salter.qb64).qb64

sigers = [signer.sign(ser=serder.raw, index=0).qb64 for signer in signers]

Expand Down Expand Up @@ -1307,7 +1307,7 @@ def test_identifier_resource_end(helpers):
sigers = [signer.sign(ser=serder.raw, index=0).qb64 for signer in signers]
salter = core.Salter(raw=salt)
encrypter = core.Encrypter(verkey=signers[0].verfer.qb64)
sxlt = encrypter.encrypt(salter.qb64).qb64
sxlt = encrypter.encrypt(ser=salter.qb64).qb64

body = {'name': 'aid1',
'icp': serder.ked,
Expand Down Expand Up @@ -1589,7 +1589,7 @@ def test_rotation(helpers):

salter = core.Salter(raw=salt)
encrypter = core.Encrypter(verkey=signers1[0].verfer.qb64)
sxlt = encrypter.encrypt(salter.qb64).qb64
sxlt = encrypter.encrypt(ser=salter.qb64).qb64

bodyid1 = {'name': 'aid1',
'icp': serder1.ked,
Expand Down Expand Up @@ -1707,4 +1707,4 @@ def test_rotation(helpers):
# rotate aid3
body = helpers.createRotate(aid=aid3, salt=salt, signers=signers3, pidx=3, ridx=1, kidx=3, wits=wits3, toad=toad3)
res = client.simulate_post(path=f"/identifiers/{aid3['name']}/events", body=json.dumps(body))
assert res.status_code == 200
assert res.status_code == 200
Loading