Skip to content

Commit

Permalink
Fixing tests, cleaning up scripts, minor bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pfeairheller committed Sep 26, 2023
1 parent 2a0f87c commit 2570524
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 297 deletions.
68 changes: 62 additions & 6 deletions scripts/multisig-create-credential.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@

import requests
from keri import kering
from keri.app import signing
from keri.app.keeping import Algos
from keri.core import coring, eventing
from keri.core.coring import Tiers
from signify.app.clienting import SignifyClient

TIME = "2023-09-25T16:01:37.000000+00:00"


def create_credential():
url = "http://localhost:3901"
Expand Down Expand Up @@ -42,11 +45,13 @@ def create_credential():
if res.status_code != requests.codes.accepted:
raise kering.AuthNError(f"unable to initialize cloud agent connection, {res.status_code}, {res.text}")

identifiers = client.identifiers()
operations = client.operations()
oobis = client.oobis()
exchanges = client.exchanges()
identifiers = client.identifiers()
registries = client.registries()
credentials = client.credentials()
exchanges = client.exchanges()
operations = client.operations()
ipex = client.ipex()

(_, _, op) = identifiers.create("multisig3", bran="0123456789lmnopqrstuv")
icp = op["response"]
Expand Down Expand Up @@ -124,24 +129,75 @@ def create_credential():
sleep(1)
print("... done")

vcp, anc, rsigs, op = registries.create(name="multisig", registryName="vLEI",
m = identifiers.get("multisig")

vcp, anc, rsigs, op = registries.create(hab=m, registryName="vLEI",
nonce="AHSNDV3ABI6U8OIgKaj3aky91ZpNL54I5_7-qwtC6q2s")

embeds = dict(
vcp=vcp.raw,
anc=eventing.messagize(serder=anc, sigers=[coring.Siger(qb64=sig) for sig in rsigs])
)

recp = ["EKYLUMmNPZeEs77Zvclf0bSN5IN-mLfLpx2ySb-HDlk4", "EJccSRTfXYF6wrUVuenAIHzwcx3hJugeiJsEKmndi5q1"]
exchanges.send("multisig3", "multisig", sender=m3, route="/multisig/vcp",
payload=dict(gid=icp.pre, usage="Issue vLEIs"),
payload=dict(gid=m["prefix"], usage="Issue vLEIs"),
embeds=embeds, recipients=recp)

print("waiting on credential registry creation...")
while not op["done"]:
op = operations.get(op["name"])
sleep(1)

print(op["response"])
print("registry created")

registry = registries.get(name="multisig", registryName="vLEI")

m = identifiers.get("multisig")
data = {
"LEI": "5493001KJTIIGC8Y1R17"
}
creder, iserder, anc, sigs, op = credentials.create(m, registry, data=data,
schema="EBfdlu8R27Fbx-ehrqwImnK-8Cm79sqbAQ4MmvEAYqao",
recipient="ELjSFdrTdCebJlmvbFNX9-TLhR2PO0_60al1kQp5_e6k",
timestamp=TIME)

prefixer = coring.Prefixer(qb64=iserder.pre)
seqner = coring.Seqner(sn=iserder.sn)
acdc = signing.serialize(creder, prefixer, seqner, iserder.saider)
iss = registries.serialize(iserder, anc)

embeds = dict(
acdc=acdc,
iss=iss,
anc=eventing.messagize(serder=anc, sigers=[coring.Siger(qb64=sig) for sig in sigs])
)
exchanges.send("multisig3", "multisig", sender=m3, route="/multisig/iss",
payload=dict(gid=m["prefix"]),
embeds=embeds, recipients=recp)

print("waiting on credential creation...")
while not op["done"]:
op = operations.get(op["name"])
sleep(1)

m = identifiers.get("multisig")
grant, sigs, end = ipex.grant(m, recp="ELjSFdrTdCebJlmvbFNX9-TLhR2PO0_60al1kQp5_e6k", acdc=acdc,
iss=iss, message="",
anc=eventing.messagize(serder=anc, sigers=[coring.Siger(qb64=sig) for sig in sigs]),
dt=TIME)

mstate = m["state"]
seal = eventing.SealEvent(i=m["prefix"], s=mstate["ee"]["s"], d=mstate["ee"]["d"])
ims = eventing.messagize(serder=grant, sigers=[coring.Siger(qb64=sig) for sig in sigs], seal=seal)
ims.extend(end)
embeds = dict(
exn=ims
)

exchanges.send("multisig3", "multisig", sender=m3, route="/multisig/exn",
payload=dict(gid=m["prefix"]),
embeds=embeds, recipients=recp)


if __name__ == "__main__":
Expand Down
103 changes: 0 additions & 103 deletions scripts/multisig-create-registry.py

This file was deleted.

169 changes: 0 additions & 169 deletions scripts/notifications.py

This file was deleted.

5 changes: 0 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@
'Operating System :: Microsoft :: Windows',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: Implementation :: CPython',
# uncomment if you test on these interpreters:
# 'Programming Language :: Python :: Implementation :: PyPy',
# 'Programming Language :: Python :: Implementation :: IronPython',
# 'Programming Language :: Python :: Implementation :: Jython',
# 'Programming Language :: Python :: Implementation :: Stackless',
'Topic :: Utilities',
],
project_urls={
Expand Down
Loading

0 comments on commit 2570524

Please sign in to comment.