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

Fix: present-proof v2 send-proposal [issue#1474] #1667

Merged
merged 22 commits into from
Apr 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
48d49a6
fix
shaangill025 Mar 14, 2022
440d530
update
shaangill025 Mar 14, 2022
71740dd
Merge branch 'main' of https://github.com/hyperledger/aries-cloudagen…
shaangill025 Mar 14, 2022
fd489d1
Merge branch 'main' into issue#1474
shaangill025 Mar 21, 2022
93bb6aa
Merge branch 'main' into issue#1474
shaangill025 Mar 24, 2022
db3b737
Merge branch 'main' of https://github.com/hyperledger/aries-cloudagen…
shaangill025 Mar 24, 2022
76766d3
Merge branch 'issue#1474' of https://github.com/shaangill025/aries-cl…
shaangill025 Mar 24, 2022
028fc06
retrigger checks
shaangill025 Mar 24, 2022
0f0d009
Merge branch 'main' into issue#1474
andrewwhitehead Mar 29, 2022
b52390f
Merge branch 'main' of https://github.com/hyperledger/aries-cloudagen…
shaangill025 Mar 29, 2022
48cf5a7
Merge branch 'issue#1474' of https://github.com/shaangill025/aries-cl…
shaangill025 Mar 29, 2022
f16f327
retrigger checks
shaangill025 Mar 29, 2022
f5f9ab0
failing int test - PR#1697 changes
shaangill025 Mar 29, 2022
05c3e18
revert commit f5f9ab0
shaangill025 Mar 30, 2022
a0b06a6
use ursa-bbs-signatures 1.0.1
shaangill025 Mar 30, 2022
6febdf7
retrigger check
shaangill025 Mar 30, 2022
97ea84d
Merge branch 'main' of https://github.com/hyperledger/aries-cloudagen…
shaangill025 Mar 30, 2022
386d04d
revert locking ursa-bbs-signature package - 1.0.2 pypi removed
shaangill025 Mar 30, 2022
2e70474
Merge branch 'main' into issue#1474
shaangill025 Mar 31, 2022
96be849
Merge branch 'main' into issue#1474
shaangill025 Apr 1, 2022
d2658c8
Merge branch 'main' into issue#1474
ianco Apr 5, 2022
18d998d
Merge branch 'main' into issue#1474
shaangill025 Apr 5, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -114,21 +114,26 @@ async def create_bound_request(
indy_proof_request = pres_ex_record.pres_proposal.attachment(
IndyPresExchangeHandler.format
)
indy_proof_request["name"] = request_data.get("name") or "proof-request"
indy_proof_request["version"] = request_data.get("version") or "1.0"
indy_proof_request["nonce"] = (
request_data.get("nonce") or await generate_pr_nonce()
)
if request_data:
indy_proof_request["name"] = request_data.get("name", "proof-request")
indy_proof_request["version"] = request_data.get("version", "1.0")
indy_proof_request["nonce"] = (
request_data.get("nonce") or await generate_pr_nonce()
)
else:
indy_proof_request["name"] = "proof-request"
indy_proof_request["version"] = "1.0"
indy_proof_request["nonce"] = await generate_pr_nonce()
return self.get_format_data(PRES_20_REQUEST, indy_proof_request)

async def create_pres(
self,
pres_ex_record: V20PresExRecord,
request_data: dict = {},
request_data: dict = None,
) -> Tuple[V20PresFormat, AttachDecorator]:
"""Create a presentation."""
requested_credentials = {}
if request_data == {}:
if not request_data:
try:
proof_request = pres_ex_record.pres_request
indy_proof_request = proof_request.attachment(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ async def test_receive_proposal(self):

assert px_rec.state == V20PresExRecord.STATE_PROPOSAL_RECEIVED

async def test_create_bound_request(self):
async def test_create_bound_request_a(self):
comment = "comment"

proposal = V20PresProposal(
Expand Down Expand Up @@ -587,6 +587,34 @@ async def test_create_bound_request(self):
assert ret_px_rec is px_rec
px_rec.save.assert_called_once()

async def test_create_bound_request_b(self):
comment = "comment"

proposal = V20PresProposal(
formats=[
V20PresFormat(
attach_id="indy",
format_=ATTACHMENT_FORMAT[PRES_20_PROPOSAL][
V20PresFormat.Format.INDY.api
],
)
],
proposals_attach=[
AttachDecorator.data_base64(INDY_PROOF_REQ_NAME, ident="indy")
],
)
px_rec = V20PresExRecord(
pres_proposal=proposal.serialize(),
role=V20PresExRecord.ROLE_VERIFIER,
)
px_rec.save = async_mock.CoroutineMock()
(ret_px_rec, pres_req_msg) = await self.manager.create_bound_request(
pres_ex_record=px_rec,
comment=comment,
)
assert ret_px_rec is px_rec
px_rec.save.assert_called_once()

async def test_create_bound_request_no_format(self):
px_rec = V20PresExRecord(
pres_proposal=V20PresProposal(
Expand Down
2 changes: 1 addition & 1 deletion requirements.bbs.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ursa-bbs-signatures==1.0.1
ursa-bbs-signatures~=1.0.1