AbsaOSS / rn-indy-sdk

This code was starting point of https://github.com/hyperledger/indy-sdk-react-native where the work continues.
Apache License 2.0
11 stars 6 forks source link

fix: matched searchCredsForProofReq method types to node wrapper #56

Closed JamesKEbert closed 3 years ago

JamesKEbert commented 3 years ago

The IndySDK Node wrapper extraQuery type in the method proverSearchCredentialsForProofReq differs from the Android and iOS types. Node allows for the parameter to be either a JSON object or null, while Java requires it to be not-null:

Possible Unhandled Promise Rejection (id: 6):
Object {
  "indyBacktrace": "",
  "indyCode": 113,
  "indyMessage": "Error: Invalid structure
  Caused by: Invalid ProofRequestExtraQuery json has been passed
  Caused by: invalid type: null, expected a map at line 1 column 4
",
  "indyName": "CommonInvalidStructure",
  "message": "CommonInvalidStructure",
  "name": "IndyError",
}

Since the tests in AFJ use the Node wrapper they didn't uncover this issue until I tried to use it from a React Native perspective. I opted to adjust the method here to align with the Node types. I'd be happy to take a different approach if desired though.