Skip to content

refactor(validate_address): expose logic for consumers - #9658

Merged
conradoplg merged 1 commit into
ZcashFoundation:mainfrom
dorianvp:refactor/expose-validateaddress
Jul 3, 2025
Merged

refactor(validate_address): expose logic for consumers#9658
conradoplg merged 1 commit into
ZcashFoundation:mainfrom
dorianvp:refactor/expose-validateaddress

Conversation

@dorianvp

Copy link
Copy Markdown
Contributor

Motivation

Zaino needs to expose a validateaddress JSON-RPC endpoint, which Zebra already implements.

Solution

Moving validate_address's body into a public function should allow consumers to re-use the address validation logic.

PR Checklist

  • The PR name is suitable for the release notes.
  • The solution is tested.
  • The documentation is up to date.

@dorianvp
dorianvp requested a review from a team as a code owner June 23, 2025 22:23
@dorianvp
dorianvp requested review from conradoplg and removed request for a team June 23, 2025 22:23
@conradoplg

Copy link
Copy Markdown
Collaborator

I'm not sure we want zebra-rpc to serve as a library for random functionality. Since the function is small, isn't it better to just copy it to Zaino, or just route the request to Zebra?

@arya2 arya2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!

@arya2

arya2 commented Jun 27, 2025

Copy link
Copy Markdown
Contributor

I'm not sure we want zebra-rpc to serve as a library for random functionality. Since the function is small, isn't it better to just copy it to Zaino, or just route the request to Zebra?

I agree that at least some of it should probably go in zebra-consensus, zebra-chain or zcash_address.

I think it'd fine to add the function here for now and move it later (it would be nice to avoid duplicating the code), but since most of the logic is already in the FromStr impl for ZcashAddress from the zcash_address crate already, copying the rest to Zaino would also be fine.

@arya2

arya2 commented Jul 2, 2025

Copy link
Copy Markdown
Contributor

@gustavovalverde any idea why CI on this PR seems stuck?

@conradoplg

Copy link
Copy Markdown
Collaborator

@gustavovalverde any idea why CI on this PR seems stuck?

All contributor PRs are getting stuck, I don't know the reason, but we've been admin-merging those. Let me know if you'd like for me to merge this.

@arya2

arya2 commented Jul 3, 2025

Copy link
Copy Markdown
Contributor

Let me know if you'd like for me to merge this.

Yes please, it can't hurt to have it factored out, even if it ends up not being used in Zaino.

@conradoplg
conradoplg merged commit d04e21a into ZcashFoundation:main Jul 3, 2025
@dorianvp
dorianvp deleted the refactor/expose-validateaddress branch July 4, 2025 09:59
@natalieesk natalieesk moved this to Won't Fix in Zebra Jul 9, 2025
@natalieesk natalieesk added this to Zebra Jul 9, 2025
aphelionz pushed a commit to ShieldedLabs/zebra-crosslink that referenced this pull request Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Won't Fix

Development

Successfully merging this pull request may close these issues.

4 participants