You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a test now that checks that the tests are skipped if the input is {}.
The problem is that in the test function, when we perform a getData, and TS shows the return type as WrappedDocument<v2.OpenAttestationDocument> not WrappedDocument<v2.OpenAttestationDocument> | undefined so it will be senseless to check for the malformed object in each and every of the verifier.
Here's some solutions, feel free to add more:
Perform the check at OA level in the getData function to ensure that the returned object is of the right shape or throw.
Perform the check BEFORE any verifications run to throw immediately instead of waiting for all the verifier to skip.
Remove the test. If the user fucks it up, it's none of our business.
The text was updated successfully, but these errors were encountered:
The problem is that in the test function, when we perform a getData, and TS shows the return type as WrappedDocument<v2.OpenAttestationDocument> not WrappedDocument<v2.OpenAttestationDocument> | undefined so it will be senseless to check for the malformed object in each and every of the verifier.
To be more accurate the problem is the difference between the compile time and the runtime type.
I'm for 2. for at least giving a good error message to the user (for 1. I don't think it concerns a lot getData to check more than the presence of the data field, but we could also throw an error from getData if there is no data field)
Problem:
There is a test now that checks that the tests are skipped if the input is {}.
The problem is that in the test function, when we perform a
getData
, and TS shows the return type asWrappedDocument<v2.OpenAttestationDocument>
notWrappedDocument<v2.OpenAttestationDocument> | undefined
so it will be senseless to check for the malformed object in each and every of the verifier.Here's some solutions, feel free to add more:
The text was updated successfully, but these errors were encountered: