provider icon indicating copy to clipboard operation
provider copied to clipboard

add more details for malformed addrs

Open alexcos20 opened this issue 2 years ago • 0 comments

If either datatokenAddress or nftAddress are malformed in the encrypted files string

(example:

b'{"datatokenAddress":"0x0","nftAddress":"0x0","files":[{"type":"url","url":"https://github.com/......0Safety%20Traffic%20Accident%20Analysis%2028eaf51fb56f4fbe80cb1ac0e552d384.pdf","method":"GET"}]}'

,provider fails with:

2024-02-07 05:59:01 provider-59c9fdb476-fl7pt ocean_provider.utils.util[12] ERROR Provider polygon: Error decrypting service files <class 'ocean_provider.utils.services.Service'>: Unknown format 0x0, attempted to normalize to 0x0
2024-02-07 05:59:01 provider-59c9fdb476-fl7pt ocean_provider.routes.consume[18] ERROR Provider polygon: Unable to get dataset files

Why? cause this is where it fails: https://github.com/oceanprotocol/provider/blob/main/ocean_provider/utils/util.py#L58 Because Web3.toChecksumAddress complains about unknown format "0x0"..

Obviously, this will fail the validation, but it will give you a clue why it failed This PR adds more detailed logs

PS: This also updates .github/workflows/pytest.yml

alexcos20 avatar Feb 07 '24 06:02 alexcos20