GSMA-CPAS / BWRP-chaincode

Apache License 2.0
1 stars 0 forks source link

Updating Test Script changes for IsValidSignature #15

Closed dhruvagarwal86 closed 3 years ago

dhruvagarwal86 commented 3 years ago

Updating offchain_test.go script with IsValidSignature Test case along with some more input from organizations.go There is minor correction in offchain.go script also.

sschulz-t commented 3 years ago

I would suggest to add a separate set of certificates for the signing part. So we have 1 set of certificates for hlf tx etc and one for signatures as they might differ.

How was "ExampleDocSignature" created? Please provide the shell script/openssl call how to (re-)generate it manually. It would be nice if this could be generated in chaincode on the fly thus changing Example data would not break it.

dhruvagarwal86 commented 3 years ago

Hi Simon, The Root certificate I am using over here is what I picked up from BWRP-development-setup master repo of github

Root Certificate of DTAG - https://github.com/GSMA-CPAS/BWRP-development-setup/blob/master/crypto-config/peerOrganizations/dtag.nomad.com/ca/ca.dtag.nomad.com-cert.pem

And It's created by the Fabric-ca Server and the User Certificate was created using the BWRP-UI backend adapter ("registerUser") https://github.com/GSMA-CPAS/BWRP-UI/blob/master/webapp/app-core/backend/adapter/ca/v1/CertAuthAdapter.js

Well, Let me create document signature on the fly in the test case itself, using the Private Key of the User. And then get it validated.

dhruvagarwal86 commented 3 years ago

Hi Marin/Simon, I have made the changes as requested. Kindly check

informartin commented 3 years ago

Hi Marin/Simon, I have made the changes as requested. Kindly check

Hi Dhruv, have you committed all changes? I can't execute the tests:

# hybrid [hybrid.test]
./offchain_test.go:372:89: data.ExampleDocument.Tmp undefined (type data.Document has no field or method Tmp)
./offchain_test.go:398:89: data.ExampleDocument.Tmp undefined (type data.Document has no field or method Tmp)
FAIL    hybrid [build failed]
dhruvagarwal86 commented 3 years ago

HI Martin, there is one file which I have just updated "document.go" in git. Kindly check now

sschulz-t commented 3 years ago

@dhruv: looking good so far. please rebase to master and fix the linter errors

dhruvagarwal86 commented 3 years ago

@sschulz-t : I have rebased the code with master and also fixed the linter errors. Kindly check.

sschulz-t commented 3 years ago

Thanks dhruv, i merged it.