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

Expose ProvenTransaction input and output note counts #992

Closed
Mirko-von-Leipzig opened this issue Nov 28, 2024 · 2 comments
Closed

Expose ProvenTransaction input and output note counts #992

Mirko-von-Leipzig opened this issue Nov 28, 2024 · 2 comments
Assignees
Milestone

Comments

@Mirko-von-Leipzig
Copy link
Contributor

Currently the only way to access these counts is via their iterators, which is inefficient.

Context here.

@Fumuran
Copy link
Contributor

Fumuran commented Nov 29, 2024

@Mirko-von-Leipzig Probably I'm missing something, but why adding count methods to the AuthenticatedTransaction doesn't work? We can add somewhere here something like this:

    pub fn num_input_notes(&self) -> usize {
        self.inner.input_notes().num_notes()
    }

    pub fn num_output_notes(&self) -> usize {
        self.inner.output_notes().num_notes()
    }

We don't have count functions in ProvenTransaction, but we have such function in the corresponding input and output notes structs. Why can't we use them?

@Mirko-von-Leipzig
Copy link
Contributor Author

@Mirko-von-Leipzig Probably I'm missing something, but why adding count methods to the AuthenticatedTransaction doesn't work? We can add somewhere here something like this:

    pub fn num_input_notes(&self) -> usize {
        self.inner.input_notes().num_notes()
    }

    pub fn num_output_notes(&self) -> usize {
        self.inner.output_notes().num_notes()
    }

We don't have count functions in ProvenTransaction, but we have such function in the corresponding input and output notes structs. Why can't we use them?

No 🤦 you are correct - no need for this functionality then.

I don't think I searched the documentation for num_xxx, was expecting a xxx_count. My bad :) And thank you for being more thorough.

@Mirko-von-Leipzig Mirko-von-Leipzig closed this as not planned Won't fix, can't repro, duplicate, stale Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

3 participants