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

adds rp to exn to work with >1.2.0-dev4 #905

Merged
merged 1 commit into from
Dec 13, 2024
Merged
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
2 changes: 1 addition & 1 deletion src/keri/app/cli/commands/escrow/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def escrows(tymth, tock=0.0, **opts):
escrows["query-not-found"] = sum(1 for key, _ in hby.db.getQnfItemsNextIter())

if (not escrow) or escrow == "partially-delegated-events":
escrows["partially-delegated-events"] = sum(1 for key, _ in hby.db.getPdesItemsNextIter())
escrows["partially-delegated-events"] = sum(1 for key, _ in hby.db.getPdeItemsNextIter())

if (not escrow) or escrow == "reply":
escrows["reply"] = sum(1 for key, _ in hby.db.rpes.getItemIter())
Expand Down
4 changes: 2 additions & 2 deletions src/keri/core/serdering.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ class Serder:
Ilks.bar: Fieldage(saids={Saids.d: DigDex.Blake3_256},
alls=dict(v='', t='',d='', dt='', r='',a=[])),
Ilks.exn: Fieldage(saids={Saids.d: DigDex.Blake3_256},
alls=dict(v='', t='', d='', i="", p="", dt='', r='',q={},
alls=dict(v='', t='', d='', i="", rp='', p="", dt='', r='',q={},
a=[], e={})),
Ilks.vcp: Fieldage(saids={Saids.d: DigDex.Blake3_256,
Saids.i: DigDex.Blake3_256,},
Expand Down Expand Up @@ -304,7 +304,7 @@ class Serder:
Ilks.bar: Fieldage(saids={Saids.d: DigDex.Blake3_256},
alls=dict(v='', t='',d='', i='', dt='', r='',a=[])),
Ilks.exn: Fieldage(saids={Saids.d: DigDex.Blake3_256},
alls=dict(v='', t='', d='', i="", p="", dt='', r='', q={},
alls=dict(v='', t='', d='', i="", rp="", p="", dt='', r='', q={},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the RP field?

Copy link
Member Author

@m00sey m00sey Dec 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR is against 1.1 - renamed to be clear.

Rp field was added 1.2.0-dev4

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR is against 1.1 - renamed to be clear.

Rp field was added 1.2.0-dev4

Sure, but what is it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Top level recipient field. This was discussed some time ago, hence its addition to 1.2.+
It was added to save unpacking the a.r field.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Top level recipient field. This was discussed some time ago, hence its addition to 1.2.+ It was added to save unpacking the a.r field.

Do you remember when? It hasn't been added to the specs yet.

Copy link
Member Author

@m00sey m00sey Dec 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The specs show Ver_2_0 but it looks like it’s ri in there, these are against Ver_1_0 and Ver_1_1

a=[], e={})),
},
},
Expand Down
1 change: 1 addition & 0 deletions src/keri/peer/exchanging.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ def exchange(route,
t=ilk,
d="",
i=sender,
rp="",
p=p,
dt=dt,
r=route,
Expand Down
16 changes: 7 additions & 9 deletions tests/app/test_delegating.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,15 @@ def test_delegation_request(mockHelpingNowUTC):
evt = hab.endorse(serder=serder)
exn, atc = delegating.delegateRequestExn(hab=hab, delpre=delpre, evt=evt)

assert atc == (b'-FABEIaGMMWJFPmtXznY1IIiKDIrg-vIyge6mBl2QV8dDjI30AAAAAAAAAAAAAAA'
b'AAAAAAAAEIaGMMWJFPmtXznY1IIiKDIrg-vIyge6mBl2QV8dDjI3-AABAADECnBl'
b'0c14SVi7Keh__sd1PVhinSy-itPr33ZxvSjJYFastqXw9ZTFGNKsY6iALUk5xP3S'
b'399tJrPFe7PtuNAN')
assert atc == (b'-FABEIaGMMWJFPmtXznY1IIiKDIrg'
b'-vIyge6mBl2QV8dDjI30AAAAAAAAAAAAAAAAAAAAAAAEIaGMMWJFPmtXznY1IIiKDIrg-vIyge6mBl2QV8dDjI3'
b'-AABAACzeUyP6__0oDca-Oiv2iGXKghBw_8sI4ZHyyeMedvz0iZIIQYqJd2Zt7cDHRh7xBGWI85J_oOixLET3mFZUu0A')

assert exn.ked["r"] == '/delegate/request'
assert exn.saidb == b'EOiDc2wEmhHc7sbLG64y2gveCIRlFe4BuISaz0mlOuZz'
assert atc == (b'-FABEIaGMMWJFPmtXznY1IIiKDIrg-vIyge6mBl2QV8dDjI30AAAAAAAAAAAAAAA'
b'AAAAAAAAEIaGMMWJFPmtXznY1IIiKDIrg-vIyge6mBl2QV8dDjI3-AABAADECnBl'
b'0c14SVi7Keh__sd1PVhinSy-itPr33ZxvSjJYFastqXw9ZTFGNKsY6iALUk5xP3S'
b'399tJrPFe7PtuNAN')
assert exn.saidb == b'EHPkcmdLGql9_1WD0wl0OalYk8PcF4HMMd7gGi-iqfSe'
assert atc == (b'-FABEIaGMMWJFPmtXznY1IIiKDIrg'
b'-vIyge6mBl2QV8dDjI30AAAAAAAAAAAAAAAAAAAAAAAEIaGMMWJFPmtXznY1IIiKDIrg-vIyge6mBl2QV8dDjI3'
b'-AABAACzeUyP6__0oDca-Oiv2iGXKghBw_8sI4ZHyyeMedvz0iZIIQYqJd2Zt7cDHRh7xBGWI85J_oOixLET3mFZUu0A')
data = exn.ked["a"]
assert data["delpre"] == delpre
embeds = exn.ked['e']
Expand Down
44 changes: 21 additions & 23 deletions tests/app/test_grouping.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,12 +638,11 @@ def test_multisig_incept(mockHelpingNowUTC):
icp=hab.makeOwnEvent(sn=hab.kever.sn))

assert exn.ked["r"] == '/multisig/icp'
assert exn.saidb == b'EGDEBUZW--n-GqOOwRflzBeqoQsYWKMOQVU_1YglG-BL'
assert atc == (b'-FABEIaGMMWJFPmtXznY1IIiKDIrg-vIyge6mBl2QV8dDjI30AAAAAAAAAAAAAAA'
b'AAAAAAAAEIaGMMWJFPmtXznY1IIiKDIrg-vIyge6mBl2QV8dDjI3-AABAAC84-o2'
b'HKwKxhL1ttzykB9zuFaGV6OpQ05b1ZJYAeBFrR7kVON1aNjpLgQCG_0bY4FUiP7F'
b'GTVDrBjuFhbeDKAH-LAa5AACAA-e-icp-AABAACihaKoLnoXxRoxGbFfOy67YSh6'
b'UxtgjT2oxupnLDz2FlhevGJKTMObbdex9f0Hqob6uTavSJvsXf5RzitskkkC')
assert exn.saidb == b'EJ6Kl50IBicAa8zND_3wMSQ5itw555V7NKid9y1SKobe'
assert atc == (b'-FABEIaGMMWJFPmtXznY1IIiKDIrg'
b'-vIyge6mBl2QV8dDjI30AAAAAAAAAAAAAAAAAAAAAAAEIaGMMWJFPmtXznY1IIiKDIrg-vIyge6mBl2QV8dDjI3'
b'-AABAACL4cf7LxzKJgaJbb7wWHLuTfj3wManDV0SW7euFNZDiEhD1kUiP3_wtOIfqB_ZsEceE4oIgOOZwFROyrcf9ScB'
b'-LAa5AACAA-e-icp-AABAACihaKoLnoXxRoxGbFfOy67YSh6UxtgjT2oxupnLDz2FlhevGJKTMObbdex9f0Hqob6uTavSJvsXf5RzitskkkC')
data = exn.ked["a"]
assert data["smids"] == aids
assert "icp" in exn.ked['e']
Expand All @@ -662,11 +661,10 @@ def test_multisig_rotate(mockHelpingNowUTC):
exn, atc = grouping.multisigRotateExn(ghab=ghab1, smids=ghab1.smids, rmids=ghab1.rmids, rot=rot)

assert exn.ked["r"] == '/multisig/rot'
assert exn.saidb == b'ENfCk9DUUck6Ixe6cYnbCbJfIsisA3H4kHPwm5Z-2Tf8'
assert atc == (b'-FABEH__mobl7NDyyQCB1DoLK-OPSueraPtZAlWEjfOYkaba0AAAAAAAAAAAAAAA'
b'AAAAAAAAEH__mobl7NDyyQCB1DoLK-OPSueraPtZAlWEjfOYkaba-AABAADChiAf'
b'iExAQ2ETkzzf7MOubXV9mL-r6fPsOI4yn348yeE5dXqdI7ddn5-wnPwNVjqqKkDp'
b'xlOEFYRiBQEbwZQC')
assert exn.saidb == b'EC2IKkvJh6_Ukx-ZWP20qyHPWpXYfZdCQkydA9HwYE9c'
assert atc == (b'-FABEH__mobl7NDyyQCB1DoLK-OPSueraPtZAlWEjfOYkaba0AAAAAAAAAAAAAAAAAAAAAAAEH__mobl7NDyyQCB1DoLK'
b'-OPSueraPtZAlWEjfOYkaba-AABAABxikcUcQLQyCuOfQXYBeyFd3hzMaaZ_wHV_KPPX8DyFcold4P8mdGC'
b'-meFY9P7qoJd3lPA1khblmqY5jhK2kAL')

data = exn.ked["a"]
assert data["smids"] == ghab1.smids
Expand Down Expand Up @@ -775,12 +773,12 @@ def test_multisig_interact(mockHelpingNowUTC):
ixn=ixn)

assert exn.ked["r"] == '/multisig/ixn'
assert exn.saidb == b'EGQ_DqGlSBx2MKJfHr6liXAngFpQ0UCtV1cdVMUtJHdN'
assert atc == (b'-FABEH__mobl7NDyyQCB1DoLK-OPSueraPtZAlWEjfOYkaba0AAAAAAAAAAAAAAA'
b'AAAAAAAAEH__mobl7NDyyQCB1DoLK-OPSueraPtZAlWEjfOYkaba-AABAAB3yX6b'
b'EXb8N63PKaMaFqijZVT5TqVtoO8q1BFnoJW3rDkNuJ9lEMpEN-44HKGtvniWZ6-d'
b'CVPS4fsEXKZAKGkB-LAa5AACAA-e-ixn-AABAABG58m7gibjdrQ8YU-8WQ8A70nc'
b'tYekYr3xdfZ5WgDQOD0bb9pI7SuuaJvzfAQisLAYQnztA82pAo1Skhf1vQwD')
assert exn.saidb == b'EDF8o6SK-s2jxUVnlGtqAVtXTF-wyZ26c0dUsS5p766q'
assert atc == (b'-FABEH__mobl7NDyyQCB1DoLK-OPSueraPtZAlWEjfOYkaba0AAAAAAAAAAAAAAAAAAAAAAAEH__mobl7NDyyQCB1DoLK'
b'-OPSueraPtZAlWEjfOYkaba'
b'-AABAABFfU5so86inNogCPN7Ko8WXvkMKeiUKPScQ3FYrVmngNpVmW8xmhOTfixuWFlLcQPjEf3bRQhvNvx7azcI_vwB'
b'-LAa5AACAA-e-ixn-AABAABG58m7gibjdrQ8YU'
b'-8WQ8A70nctYekYr3xdfZ5WgDQOD0bb9pI7SuuaJvzfAQisLAYQnztA82pAo1Skhf1vQwD')
data = exn.ked["a"]
assert data["smids"] == ghab1.smids
assert data["gid"] == ghab1.pre
Expand All @@ -795,12 +793,12 @@ def test_multisig_registry_incept(mockHelpingNowUTC, mockCoringRandomNonce):
usage="Issue vLEI Credentials")

assert exn.ked["r"] == '/multisig/vcp'
assert exn.saidb == b'ECKiNFo7fpG4vS5tUeja3EvOqT8ctq4AW8E3HKsP7dJo'
assert atc == (b'-FABEH__mobl7NDyyQCB1DoLK-OPSueraPtZAlWEjfOYkaba0AAAAAAAAAAAAAAA'
b'AAAAAAAAEH__mobl7NDyyQCB1DoLK-OPSueraPtZAlWEjfOYkaba-AABAABh6d0m'
b'lebT57L8o2si7DfEvPCoXJP0ekPiBqkzQns3-P7dz36MPXhjNFW6xRRdUstDLAZe'
b'BEqBxBCltMpTZGsD-LAa5AACAA-e-anc-AABAAD2mK9ICW9x1-0NZGkEDOcAbZ58'
b'VWK9LOTwyN2lSfHr2zY638P1SBStoh8mjgy7nOTGMyujOXMKvF_ZDeQ_ISYA')
assert exn.saidb == b'ELTlVFjqhqLkGBqItC9P6RADjranADW8FwD7nnz5ngwO'
assert atc == (b'-FABEH__mobl7NDyyQCB1DoLK-OPSueraPtZAlWEjfOYkaba0AAAAAAAAAAAAAAAAAAAAAAAEH__mobl7NDyyQCB1DoLK'
b'-OPSueraPtZAlWEjfOYkaba'
b'-AABAABY2UZSi_FQRViWfk_wdBmbgPUus1PtJzBPUDpfKEYvhHhsT6IB7z3IswPlrwUc0rTwjN1ON9ssFoTtTlMJqG8K'
b'-LAa5AACAA-e-anc-AABAAD2mK9ICW9x1'
b'-0NZGkEDOcAbZ58VWK9LOTwyN2lSfHr2zY638P1SBStoh8mjgy7nOTGMyujOXMKvF_ZDeQ_ISYA')
data = exn.ked["a"]
assert data == {'gid': 'EERn_laF0qwP8zTBGL86LbF84J0Yh2IvQSRskH3BZZiy',
'usage': 'Issue vLEI Credentials'}
Expand Down
24 changes: 12 additions & 12 deletions tests/app/test_oobiing.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,21 @@ def test_oobi_share(mockHelpingNowUTC):

exn, atc = oobiing.oobiRequestExn(hab=hab, dest="EO2kxXW0jifQmuPevqg6Zpi3vE-WYoj65i_XhpruWtOg",
oobi="http://127.0.0.1/oobi")
assert exn.ked == {'a': {'dest': 'EO2kxXW0jifQmuPevqg6Zpi3vE-WYoj65i_XhpruWtOg',
'oobi': 'http://127.0.0.1/oobi'},
'd': 'EMAhEMPbBU2B-Ha-yLxMEZk49KHYkzZgMv9aZS8gDl1m',
'dt': '2021-01-01T00:00:00.000000+00:00',
'e': {},
assert exn.ked == {'v': 'KERI10JSON000136_', 't': 'exn', 'd': 'EII7EvdWFqv0jkjRv10t01zAUcRYbjVhZ_yo3VPZEbpS',
'i': 'EIaGMMWJFPmtXznY1IIiKDIrg-vIyge6mBl2QV8dDjI3',
'rp': '',
'p': '',
'q': {},
'dt': '2021-01-01T00:00:00.000000+00:00',
'r': '/oobis',
't': 'exn',
'v': 'KERI10JSON00012e_'}
assert atc == (b'-FABEIaGMMWJFPmtXznY1IIiKDIrg-vIyge6mBl2QV8dDjI30AAAAAAAAAAAAAAA'
b'AAAAAAAAEIaGMMWJFPmtXznY1IIiKDIrg-vIyge6mBl2QV8dDjI3-AABAACsgmsu'
b'VJoY5a7vicZQ7pT_MZqCe-0psgReRxyoBfFaAPxZ7Vss2eteFuvwDWBeyKc1B-yc'
b'p-2QZzIZJ94_9hIP')
'q': {},
'a': {
'dest': 'EO2kxXW0jifQmuPevqg6Zpi3vE-WYoj65i_XhpruWtOg',
'oobi': 'http://127.0.0.1/oobi'},
'e': {}
}
assert atc == (b'-FABEIaGMMWJFPmtXznY1IIiKDIrg'
b'-vIyge6mBl2QV8dDjI30AAAAAAAAAAAAAAAAAAAAAAAEIaGMMWJFPmtXznY1IIiKDIrg-vIyge6mBl2QV8dDjI3'
b'-AABAABdw3eSw_7BW2o3z1ufxxs1CPgX1TgtJzn-MxvMjLYTidUd8KSxNKbPU9M3A4orYJDMGMIzhabHJmKA4ZIGbcgK')


def test_oobiery():
Expand Down
16 changes: 7 additions & 9 deletions tests/core/test_serdering.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_serder():
'rpy': Fieldage(saids={'d': 'E'}, alls={'v': '', 't': '', 'd': '', 'dt': '', 'r': '', 'a': []}),
'pro': Fieldage(saids={'d': 'E'}, alls={'v': '', 't': '', 'd': '', 'dt': '', 'r': '', 'rr': '', 'q': {}}),
'bar': Fieldage(saids={'d': 'E'}, alls={'v': '', 't': '', 'd': '', 'dt': '', 'r': '', 'a': []}),
'exn': Fieldage(saids={'d': 'E'}, alls={'v': '', 't': '', 'd': '', 'i': '', 'p': '', 'dt': '', 'r': '', 'q': {}, 'a': [], 'e': {}}),
'exn': Fieldage(saids={'d': 'E'}, alls={'v': '', 't': '', 'd': '', 'i': '', 'rp': '', 'p': '', 'dt': '', 'r': '', 'q': {}, 'a': [], 'e': {}}),
'vcp': Fieldage(saids={'d': 'E', 'i': 'E'}, alls={'v': '', 't': '', 'd': '', 'i': '', 'ii': '', 's': '0', 'c': [], 'bt': '0', 'b': [], 'n': ''}),
'vrt': Fieldage(saids={'d': 'E'}, alls={'v': '', 't': '', 'd': '', 'i': '', 'p': '', 's': '0', 'bt': '0', 'br': [], 'ba': []}),
'iss': Fieldage(saids={'d': 'E'}, alls={'v': '', 't': '', 'd': '', 'i': '', 's': '0', 'ri': '', 'dt': ''}),
Expand All @@ -56,7 +56,7 @@ def test_serder():
'rpy': Fieldage(saids={'d': 'E'}, alls={'v': '', 't': '', 'd': '', 'i': '', 'dt': '', 'r': '', 'a': []}),
'pro': Fieldage(saids={'d': 'E'}, alls={'v': '', 't': '', 'd': '', 'i': '', 'dt': '', 'r': '', 'rr': '', 'q': {}}),
'bar': Fieldage(saids={'d': 'E'}, alls={'v': '', 't': '', 'd': '', 'i': '', 'dt': '', 'r': '', 'a': []}),
'exn': Fieldage(saids={'d': 'E'}, alls={'v': '', 't': '', 'd': '', 'i': '', 'p': '', 'dt': '', 'r': '', 'q': {}, 'a': [], 'e': {}})}},
'exn': Fieldage(saids={'d': 'E'}, alls={'v': '', 't': '', 'd': '', 'i': '', 'rp': '', 'p': '', 'dt': '', 'r': '', 'q': {}, 'a': [], 'e': {}})}},
'CREL': {Versionage(major=1, minor=1): {'vcp': Fieldage(saids={'d': 'E', 'i': 'E'}, alls={'v': '', 't': '', 'd': '', 'i': '', 'ii': '', 's': '0', 'c': [], 'bt': '0', 'b': [], 'u': ''}),
'vrt': Fieldage(saids={'d': 'E'}, alls={'v': '', 't': '', 'd': '', 'i': '', 'p': '', 's': '0', 'bt': '0', 'br': [], 'ba': []}),
'iss': Fieldage(saids={'d': 'E'}, alls={'v': '', 't': '', 'd': '', 'i': '', 's': '0', 'ri': '', 'dt': ''}),
Expand Down Expand Up @@ -2092,22 +2092,20 @@ def test_serderkeri_exn():

# Test KERI JSON with makify defaults for self bootstrap with ilk ixn
serder = SerderKERI(makify=True, ilk=kering.Ilks.exn) # make with defaults
assert serder.sad == {'v': 'KERI10JSON000088_',
assert serder.sad == {'v': 'KERI10JSON000090_',
't': 'exn',
'd': 'EMuAoRSE4zREKKYyvuNeYCDM9_MwPQIh1WL0cFC4e-bU',
'd': 'EPx9pShQTfv2FoISZJAZ4dlUcekG8-CSkgJh0i0q_iJn',
'i': '',
'rp': '',
'p': '',
'dt': '',
'r': '',
'q': {},
'a': [],
'e': {}}

assert serder.raw == (b'{"v":"KERI10JSON000088_","t":"exn",'
b'"d":"EMuAoRSE4zREKKYyvuNeYCDM9_MwPQIh1WL0'
b'cFC4e-bU","i":"","p":"","dt":"","r":"","q":{},"a":[],"e":{}}')


assert serder.raw == (b'{"v":"KERI10JSON000090_","t":"exn","d":"EPx9pShQTfv2FoISZJAZ4dlUcekG8-CSkgJh0i0q_iJn",'
b'"i":"","rp":"","p":"","dt":"","r":"","q":{},"a":[],"e":{}}')

assert serder.verify() # because pre is empty
assert serder.ilk == kering.Ilks.exn
Expand Down
Loading
Loading