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

chore: add aex9 validation to v1 hash endpoints #779

Merged
merged 2 commits into from
Jul 11, 2022

Conversation

jyeshe
Copy link
Member

@jyeshe jyeshe commented Jul 8, 2022

Resolves #780

@jyeshe jyeshe self-assigned this Jul 8, 2022
@jyeshe jyeshe requested review from sborrazas and thepiwo July 8, 2022 18:40
balance_for_hash_reply(
conn,
contract_pk,
Validate.id!(account_id, [:account_pubkey]),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we can start using {:ok, account_pk} <- Validate.id(....) do at the top to stop dealing with both error return values and exception errors?

It would be nice if we only dealt with just one of them, in particular, I think exceptions are very much error prone, so I would like to continue with the functional approach of returning an error tuple. Thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the exceptions help with deeper propagation but for these validations close to the border I like the idea of refactoring incrementally to use tagged errors.

@jyeshe jyeshe requested a review from sborrazas July 11, 2022 21:14
@jyeshe jyeshe merged commit 62e7c75 into master Jul 11, 2022
@jyeshe jyeshe deleted the v1-validate-aex9-at-hash branch July 11, 2022 21:18
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.

Exception on v1 aex9 blockhash endpoints when contract is not present yet
3 participants