Draft
Conversation
nachog00
reviewed
Mar 13, 2026
zingo-netutils/src/lib.rs
Outdated
| } | ||
|
|
||
| impl Indexer for GrpcIndexer { | ||
| type Error = GrpcIndexerError; |
There was a problem hiding this comment.
I don't love that, with this approach, calls to get_info need to handle a GrpcIndexerError::SendRejected variant, for example.
Member
There was a problem hiding this comment.
Would it be better to have per-method error enums instead?
There was a problem hiding this comment.
I think so. Even an error struct per method if there's a single failure mode.
nachog00
reviewed
Mar 13, 2026
zingo-netutils/src/lib.rs
Outdated
|
|
||
| /// Trait for communicating with a Zcash chain indexer. | ||
| pub trait Indexer { | ||
| type Error; |
There was a problem hiding this comment.
A trait bound to the std Error here would be very good
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #52
When tested against zingolib all lints and (140) tests pass.
This trait-based interface is going to be very useful for mocking out calls to the indexer. I wanted it to test offline-mode.