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

add more details for malformed addrs #676

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

alexcos20
Copy link
Member

@alexcos20 alexcos20 commented Feb 7, 2024

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

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

Successfully merging this pull request may close these issues.

None yet

2 participants