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

didMetadataStructureTest_r is not defined #112

Closed
fqutishat opened this issue May 19, 2021 · 11 comments
Closed

didMetadataStructureTest_r is not defined #112

fqutishat opened this issue May 19, 2021 · 11 comments

Comments

@fqutishat
Copy link
Contributor

    ReferenceError: didMetadataStructureTest_r is not defined

      24 |             Object.keys(didDocumentMetadata).forEach((property_name) => {
      25 |                 if (typeof didDocumentMetadata[property_name] == "object") {
    > 26 |                     didMetadataStructureTest_r(didDocumentMetadata[property_name]);
         |                     ^
      27 |                 }
      28 |             });
      29 |         });

      at forEach (suites/did-core-properties/did-metadata-structure.js:26:21)
          at Array.forEach (<anonymous>)
      at Object.<anonymous> (suites/did-core-properties/did-metadata-structure.js:24:46)

didMetadataStructureTest_r(didDocumentMetadata[property_name]);

@shigeya
Copy link
Contributor

shigeya commented May 20, 2021

@fqutishat Thank you very much for spotting this. This code path is not used unless you run with a metadata property with an object as a value.

If you need to run the test with such a metadata, please rename

didMetadataStructureTest_r

to

didMetadataStructureTest_Map_Recursive

Then, it should work.

I will create PR for the repository.

shigeya added a commit to shigeya/did-test-suite that referenced this issue May 20, 2021
- Adderssing issue w3c#112:
  eliminating remaing function call to `didMetadataStructureTest_r`
shigeya added a commit to shigeya/did-test-suite that referenced this issue May 20, 2021
- Adderssing issue w3c#112:
  eliminating remaing function call to `didMetadataStructureTest_r`
msporny pushed a commit that referenced this issue May 20, 2021
- Adderssing issue #112:
  eliminating remaing function call to `didMetadataStructureTest_r`
@shigeya
Copy link
Contributor

shigeya commented May 20, 2021

@fqutishat The current head of the main branch merged the fix. please try.

@msporny Please mark this issue as pending close.

@msporny
Copy link
Member

msporny commented May 21, 2021

@msporny Please mark this issue as pending close.

We only need to do that on DID Core... we can close issues on the test suite as they're confirmed. All we need is @fqutishat to say you fixed his issue and we can close.

@fqutishat
Copy link
Contributor Author

fqutishat commented May 21, 2021

@msporny @shigeya I have this error now. Tests cannot be nested.

 ● 7.3 Metadata Structure - did:orb - DID Orb Test Suite - SecureKey › did:orb:interim:EiC-dLIbtnkHnfc6_Wkc8-X8Ag8FhvpC-jIMrT29_S_ttw › application/did+ld+json › 7.3 Metadata Structure - The values within any complex data structures such as maps and lists MUST be one of these data types as well.

    Tests cannot be nested. Test "7.3 Metadata Structure - The structure used to communicate this metadata MUST be a map of properties." cannot run because it is nested within "7.3 Metadata Structure - The values within any complex data structures such as maps and lists MUST be one of these data types as well.".

      1 | const didMetadataStructureTest_Map_Recursive = (didDocumentMetadata) => {
    > 2 |     it('7.3 Metadata Structure - ' +
        |     ^
      3 |        'The structure used to communicate this metadata MUST be a map of properties.', () => {
      4 |         expect(didDocumentMetadata).toBeInfraMap();
      5 |     });

      at Env.it (node_modules/jest-jasmine2/build/jasmine/Env.js:605:19)
      at didMetadataStructureTest_Map_Recursive (suites/did-core-properties/did-metadata-structure.js:2:5)
      at forEach (suites/did-core-properties/did-metadata-structure.js:26:21)
          at Array.forEach (<anonymous>)
      at Object.<anonymous> (suites/did-core-properties/did-metadata-structure.js:24:46)

@shigeya
Copy link
Contributor

shigeya commented May 21, 2021

@fqutishat Ah, right. I see. I need to find a workaround...

Would you please provide the implementation JSON data you have? via gist.github.com or other ways? then I can fix the problem.

fqutishat added a commit to fqutishat/did-test-suite that referenced this issue May 21, 2021
list of did samples:

- did:orb:interim:EiDHdXhNm7LuCqxo4JvAwKYKiFmpf85YFswAovxTxI_y4Q (interim did, local cas, V1 CID, P-256 JsonWebKey2020, empty service)
- did:orb:bafkreiazah4qrybzyapmrmk2dhldz24vfmavethcrgcoq7qhic63zz55ru:EiAag4cmgxAE2isL5HG3mxjS7WRq4l-xyyTgULCAcEHQQQ (canonical did, local cas, V1 CID, P-256 JsonWebKey2020, empty service)
- did:orb:bafkreihp4inweep4py7gw4j7hej5mqlbwa7br4u7mtrfxr5khfwpu3qu3m:EiB2tmdM_oWwjXj6AmVLm0RFa_8XKZHipOpNGpEODIVN8Q (canonical did, local cas, V1 CID, ed25519 Ed25519VerificationKey2018, DIDComm v1 service)
- did:orb:bafkreibcsubh3ifub7gletz27hcdyhwvrhlh5mwfth2m5fbasqua6yalay:EiA2ZtZqXjKZt-yf19ersmaCYm-gJEnlixrfk0Mi61ETTg (canonical did, local cas, V1 CID, P-256 JsonWebKey2020, DIDComm v2 service)
- did:orb:webcas:testnet.orb.local:bafkreihdnftiso5b7bzmhhi65nzsutbcuv6mtrmuquzoqlrk7joyer45uq:EiARiEOCLK3GnRVHA_yF92tX3aoSJAVqW1bh7Enre1iDXw (webcas did, local cas, V1 CID, P-256 JsonWebKey2020, DIDComm v2 service)
- did:orb:interim:EiCYgffdSsqLTXT6PRYLPr6vvgn9PVecJ5nFUGh9hXgOxQ (interim did, ipfs, V1 CID, P-256 JsonWebKey2020, DIDComm v2 service)
- did:orb:ipfs:bafkreiacr3ga6zilvzatpcixq5mz4uvgld7yedutgcssvnmql44o6rc7yy:EiB2k0ytmo-qi_M7jGocxvj4P9D6VQJGl6gRy4f6-UUpTw (ipfs did, ipfs, V1 CID, P-256 JsonWebKey2020, DIDComm v2 service)
- did:orb:ipfs:QmfX6CHk7AC43Xq9iFK9XzgH3a7kJeAn3ewWZxEcqur2wE:EiCnmXoUEEP-04kELpPiF7Ss5GesCCedfTgRPA30SJO5KQ (ipfs did, ipfs, V0 CID, P-256 JsonWebKey2020, DIDComm v2 service)
- did:orb:ipfs:QmX13HDUkfcbR2Tes5VqXeypKmDC9B2bkqKsx6pNSeVPFw:EiDBMrOVrw71NGSDxw8LyTt5ulTJo2Xr9fPHfSSDD7wBlw (ipfs did, ipfs, V0 CID, BLS12381G2 Bls12381G2Key2020, DIDComm v2 service)

Result: 14 failed, 15 todo, 1824 passed, 1853 total

1 failure related to this issue trustbloc/orb#419
4 failure related to this issue w3c#116
9 failure related to this issue w3c#112

Signed-off-by: Firas Qutishat <[email protected]>
@troyronda
Copy link

@shigeya Please see PR #117

@shigeya
Copy link
Contributor

shigeya commented May 21, 2021

@troyronda @fqutishat thanks. Will fix it tomorrow Japanese time.

fqutishat added a commit to fqutishat/did-test-suite that referenced this issue May 21, 2021
list of did samples:

- did:orb:interim:EiDHdXhNm7LuCqxo4JvAwKYKiFmpf85YFswAovxTxI_y4Q (interim did, local cas, V1 CID, P-256 JsonWebKey2020, empty service)
- did:orb:bafkreiazah4qrybzyapmrmk2dhldz24vfmavethcrgcoq7qhic63zz55ru:EiAag4cmgxAE2isL5HG3mxjS7WRq4l-xyyTgULCAcEHQQQ (canonical did, local cas, V1 CID, P-256 JsonWebKey2020, empty service)
- did:orb:bafkreihp4inweep4py7gw4j7hej5mqlbwa7br4u7mtrfxr5khfwpu3qu3m:EiB2tmdM_oWwjXj6AmVLm0RFa_8XKZHipOpNGpEODIVN8Q (canonical did, local cas, V1 CID, ed25519 Ed25519VerificationKey2018, DIDComm v1 service)
- did:orb:bafkreibcsubh3ifub7gletz27hcdyhwvrhlh5mwfth2m5fbasqua6yalay:EiA2ZtZqXjKZt-yf19ersmaCYm-gJEnlixrfk0Mi61ETTg (canonical did, local cas, V1 CID, P-256 JsonWebKey2020, DIDComm v2 service)
- did:orb:webcas:testnet.orb.local:bafkreihdnftiso5b7bzmhhi65nzsutbcuv6mtrmuquzoqlrk7joyer45uq:EiARiEOCLK3GnRVHA_yF92tX3aoSJAVqW1bh7Enre1iDXw (webcas did, local cas, V1 CID, P-256 JsonWebKey2020, DIDComm v2 service)
- did:orb:interim:EiCYgffdSsqLTXT6PRYLPr6vvgn9PVecJ5nFUGh9hXgOxQ (interim did, ipfs, V1 CID, P-256 JsonWebKey2020, DIDComm v2 service)
- did:orb:ipfs:bafkreiacr3ga6zilvzatpcixq5mz4uvgld7yedutgcssvnmql44o6rc7yy:EiB2k0ytmo-qi_M7jGocxvj4P9D6VQJGl6gRy4f6-UUpTw (ipfs did, ipfs, V1 CID, P-256 JsonWebKey2020, DIDComm v2 service)
- did:orb:ipfs:QmfX6CHk7AC43Xq9iFK9XzgH3a7kJeAn3ewWZxEcqur2wE:EiCnmXoUEEP-04kELpPiF7Ss5GesCCedfTgRPA30SJO5KQ (ipfs did, ipfs, V0 CID, P-256 JsonWebKey2020, DIDComm v2 service)
- did:orb:ipfs:QmS4ZME5uEPtQ2DFDwhSZYtLxzFxCYjJ6kC7o3ypwanzFm:EiACG5GI9dK1fjnCMYMA6ZFhtP75HVhunEuqW-XDCAU7Ew (ipfs did, ipfs, V0 CID, BLS12381_G2 Bls12381G2Key2020, DIDComm v2 service)
- did:orb:ipfs:QmfJFePqcopDUYttpvWgec9LKeJhnwh4UjhwUJz5ZcRUqM:EiDwFxa7ooPvKDTqpemH-R-H0pNX9VzUEUzk8AZsMCf9pg (ipfs did, ipfs, V0 CID, P-384 JsonWebKey2020, DIDComm v2 service)
- did:orb:interim:EiAQ1HmY03Cx4OMhiuYHl8q-B1JYlkT1Wns-dhhccUIl5g:eyJkZWx0YSI6eyJwYXRjaGVzIjpbeyJhY3Rpb24iOiJhZGQtcHVibGljLWtleXMiLCJwdWJsaWNLZXlzIjpbeyJpZCI6ImNyZWF0ZUtleSIsInB1YmxpY0tleUp3ayI6eyJjcnYiOiJQLTI1NiIsImt0eSI6IkVDIiwieCI6InJILURtZmNkRVZERi1vNm80ellxdjl2YlhPcFFFcDd3RC1XUHFDbl9ELXciLCJ5IjoidnBiRGNQX2YwS1JoRW02Sm93Y0oxbWlNTldJRXo2YWVnRHFDek80WXNxSSJ9LCJwdXJwb3NlcyI6WyJhdXRoZW50aWNhdGlvbiJdLCJ0eXBlIjoiSnNvbldlYktleTIwMjAifSx7ImlkIjoiYXV0aCIsInB1YmxpY0tleUp3ayI6eyJjcnYiOiJFZDI1NTE5Iiwia3R5IjoiT0tQIiwieCI6IjEzNkZDRjJTSEZNMUZ6aWlJYXJwNEI1RzkxUVNnNHB1dGFhSWg1VEdXREEiLCJ5IjoiIn0sInB1cnBvc2VzIjpbImFzc2VydGlvbk1ldGhvZCJdLCJ0eXBlIjoiRWQyNTUxOVZlcmlmaWNhdGlvbktleTIwMTgifV19LHsiYWN0aW9uIjoiYWRkLXNlcnZpY2VzIiwic2VydmljZXMiOlt7ImlkIjoiZGlkY29tbSIsInByaW9yaXR5IjowLCJyZWNpcGllbnRLZXlzIjpbIjZLWjZLQkZLZDQ3d3FEMlhnelJwTDZ0RGlxQkNnQzg1eEttbzhVRHExZjVSIl0sInJvdXRpbmdLZXlzIjpbIjhrNUY0bXVQN0s3NmVtZHdQNWlDOHJlRVlWb1NiWmdMM2FudmFXOTdUTm1yIl0sInNlcnZpY2VFbmRwb2ludCI6Imh0dHBzOi8vaHViLmV4YW1wbGUuY29tLy5pZGVudGl0eS9kaWQ6ZXhhbXBsZTowMTIzNDU2Nzg5YWJjZGVmLyIsInR5cGUiOiJkaWQtY29tbXVuaWNhdGlvbiJ9XX1dLCJ1cGRhdGVDb21taXRtZW50IjoiRWlEVXVaSFEwOENXRGVBTmJyc3VSeHh3M2V5bXNucFdNbzJ0TXQ3QUNlUUNIUSJ9LCJzdWZmaXhEYXRhIjp7ImFuY2hvck9yaWdpbiI6Imh0dHBzOi8vb3JiLmRvbWFpbjEuY29tL3NlcnZpY2VzL29yYiIsImRlbHRhSGFzaCI6IkVpQUluS05tb0d1WDJVajI1aGFCNDdGQlF4aGpmb0lJYzc3Y2h6N0p0enJXdVEiLCJyZWNvdmVyeUNvbW1pdG1lbnQiOiJFaUNIOWF3WHZQUFZZdVBneEw2WUFQX3FaeUktMzdxclcwQkdFT2o5cnJWbHd3In19 (long-form did, V1 CID, P-256 JsonWebKey2020 ed25519 Ed25519VerificationKey2018)

Result: 16 failed, 17 todo, 1902 passed, 1935 total

1 failure related to this issue w3c#118
4 failure related to this issue w3c#116
11 failure related to this issue w3c#112

Signed-off-by: Firas Qutishat <[email protected]>
@shigeya
Copy link
Contributor

shigeya commented May 22, 2021

@troyronda @fqutishat PR #122 addressed the above issue.

msporny pushed a commit that referenced this issue May 24, 2021
list of did samples:

- did:orb:interim:EiDHdXhNm7LuCqxo4JvAwKYKiFmpf85YFswAovxTxI_y4Q (interim did, local cas, V1 CID, P-256 JsonWebKey2020, empty service)
- did:orb:bafkreiazah4qrybzyapmrmk2dhldz24vfmavethcrgcoq7qhic63zz55ru:EiAag4cmgxAE2isL5HG3mxjS7WRq4l-xyyTgULCAcEHQQQ (canonical did, local cas, V1 CID, P-256 JsonWebKey2020, empty service)
- did:orb:bafkreihp4inweep4py7gw4j7hej5mqlbwa7br4u7mtrfxr5khfwpu3qu3m:EiB2tmdM_oWwjXj6AmVLm0RFa_8XKZHipOpNGpEODIVN8Q (canonical did, local cas, V1 CID, ed25519 Ed25519VerificationKey2018, DIDComm v1 service)
- did:orb:bafkreibcsubh3ifub7gletz27hcdyhwvrhlh5mwfth2m5fbasqua6yalay:EiA2ZtZqXjKZt-yf19ersmaCYm-gJEnlixrfk0Mi61ETTg (canonical did, local cas, V1 CID, P-256 JsonWebKey2020, DIDComm v2 service)
- did:orb:webcas:testnet.orb.local:bafkreihdnftiso5b7bzmhhi65nzsutbcuv6mtrmuquzoqlrk7joyer45uq:EiARiEOCLK3GnRVHA_yF92tX3aoSJAVqW1bh7Enre1iDXw (webcas did, local cas, V1 CID, P-256 JsonWebKey2020, DIDComm v2 service)
- did:orb:interim:EiCYgffdSsqLTXT6PRYLPr6vvgn9PVecJ5nFUGh9hXgOxQ (interim did, ipfs, V1 CID, P-256 JsonWebKey2020, DIDComm v2 service)
- did:orb:ipfs:bafkreiacr3ga6zilvzatpcixq5mz4uvgld7yedutgcssvnmql44o6rc7yy:EiB2k0ytmo-qi_M7jGocxvj4P9D6VQJGl6gRy4f6-UUpTw (ipfs did, ipfs, V1 CID, P-256 JsonWebKey2020, DIDComm v2 service)
- did:orb:ipfs:QmfX6CHk7AC43Xq9iFK9XzgH3a7kJeAn3ewWZxEcqur2wE:EiCnmXoUEEP-04kELpPiF7Ss5GesCCedfTgRPA30SJO5KQ (ipfs did, ipfs, V0 CID, P-256 JsonWebKey2020, DIDComm v2 service)
- did:orb:ipfs:QmS4ZME5uEPtQ2DFDwhSZYtLxzFxCYjJ6kC7o3ypwanzFm:EiACG5GI9dK1fjnCMYMA6ZFhtP75HVhunEuqW-XDCAU7Ew (ipfs did, ipfs, V0 CID, BLS12381_G2 Bls12381G2Key2020, DIDComm v2 service)
- did:orb:ipfs:QmfJFePqcopDUYttpvWgec9LKeJhnwh4UjhwUJz5ZcRUqM:EiDwFxa7ooPvKDTqpemH-R-H0pNX9VzUEUzk8AZsMCf9pg (ipfs did, ipfs, V0 CID, P-384 JsonWebKey2020, DIDComm v2 service)
- did:orb:interim:EiAQ1HmY03Cx4OMhiuYHl8q-B1JYlkT1Wns-dhhccUIl5g:eyJkZWx0YSI6eyJwYXRjaGVzIjpbeyJhY3Rpb24iOiJhZGQtcHVibGljLWtleXMiLCJwdWJsaWNLZXlzIjpbeyJpZCI6ImNyZWF0ZUtleSIsInB1YmxpY0tleUp3ayI6eyJjcnYiOiJQLTI1NiIsImt0eSI6IkVDIiwieCI6InJILURtZmNkRVZERi1vNm80ellxdjl2YlhPcFFFcDd3RC1XUHFDbl9ELXciLCJ5IjoidnBiRGNQX2YwS1JoRW02Sm93Y0oxbWlNTldJRXo2YWVnRHFDek80WXNxSSJ9LCJwdXJwb3NlcyI6WyJhdXRoZW50aWNhdGlvbiJdLCJ0eXBlIjoiSnNvbldlYktleTIwMjAifSx7ImlkIjoiYXV0aCIsInB1YmxpY0tleUp3ayI6eyJjcnYiOiJFZDI1NTE5Iiwia3R5IjoiT0tQIiwieCI6IjEzNkZDRjJTSEZNMUZ6aWlJYXJwNEI1RzkxUVNnNHB1dGFhSWg1VEdXREEiLCJ5IjoiIn0sInB1cnBvc2VzIjpbImFzc2VydGlvbk1ldGhvZCJdLCJ0eXBlIjoiRWQyNTUxOVZlcmlmaWNhdGlvbktleTIwMTgifV19LHsiYWN0aW9uIjoiYWRkLXNlcnZpY2VzIiwic2VydmljZXMiOlt7ImlkIjoiZGlkY29tbSIsInByaW9yaXR5IjowLCJyZWNpcGllbnRLZXlzIjpbIjZLWjZLQkZLZDQ3d3FEMlhnelJwTDZ0RGlxQkNnQzg1eEttbzhVRHExZjVSIl0sInJvdXRpbmdLZXlzIjpbIjhrNUY0bXVQN0s3NmVtZHdQNWlDOHJlRVlWb1NiWmdMM2FudmFXOTdUTm1yIl0sInNlcnZpY2VFbmRwb2ludCI6Imh0dHBzOi8vaHViLmV4YW1wbGUuY29tLy5pZGVudGl0eS9kaWQ6ZXhhbXBsZTowMTIzNDU2Nzg5YWJjZGVmLyIsInR5cGUiOiJkaWQtY29tbXVuaWNhdGlvbiJ9XX1dLCJ1cGRhdGVDb21taXRtZW50IjoiRWlEVXVaSFEwOENXRGVBTmJyc3VSeHh3M2V5bXNucFdNbzJ0TXQ3QUNlUUNIUSJ9LCJzdWZmaXhEYXRhIjp7ImFuY2hvck9yaWdpbiI6Imh0dHBzOi8vb3JiLmRvbWFpbjEuY29tL3NlcnZpY2VzL29yYiIsImRlbHRhSGFzaCI6IkVpQUluS05tb0d1WDJVajI1aGFCNDdGQlF4aGpmb0lJYzc3Y2h6N0p0enJXdVEiLCJyZWNvdmVyeUNvbW1pdG1lbnQiOiJFaUNIOWF3WHZQUFZZdVBneEw2WUFQX3FaeUktMzdxclcwQkdFT2o5cnJWbHd3In19 (long-form did, V1 CID, P-256 JsonWebKey2020 ed25519 Ed25519VerificationKey2018)

Result: 16 failed, 17 todo, 1902 passed, 1935 total

1 failure related to this issue #118
4 failure related to this issue #116
11 failure related to this issue #112

Signed-off-by: Firas Qutishat <[email protected]>
@fqutishat
Copy link
Contributor Author

@shigeya thank you for your fix but now I have new error

   TypeError: expect(...).toBeDidDocumentMap is not a function

      30 |                             Object.keys(didDocumentMetadata).forEach((property_name) => {
      31 |                                 if (typeof didDocumentMetadata[property_name] == "object") {
    > 32 |                                     expect(didDocumentMetadata[property_name]).toBeDidDocumentMap();
         |                                                                                ^
      33 |                                 }
      34 |                             });
      35 |                         });

@shigeya
Copy link
Contributor

shigeya commented May 24, 2021

@fqutishat That's odd. Did you ran lerna run prepare at the top level?

The current main branch (HEAD at 8749150) includes did:orb implementation and not throwing the error.

@fqutishat
Copy link
Contributor Author

@shigeya yes it works now after run lerna run prepare at the top level. I will close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants