-
Notifications
You must be signed in to change notification settings - Fork 63
feat(minibf): add txs required signers endpoint #1232
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: txpipe/dolos
Length of output: 26940
🏁 Script executed:
Repository: txpipe/dolos
Length of output: 23230
🌐 Web query:
Clippy needless_collect lint Rust documentation collect into_iter map💡 Result:
The Clippy lint
clippy::needless_collectwarns against collecting an iterator into a temporary collection (like aVec,LinkedList, orHashMap) when that collection is immediately used in a way that could have been performed directly on the iterator [1][2]. ### What it does Collecting an iterator into a collection requires heap allocation and consumes the iterator [1]. If you only need to perform operations such as checking the size, verifying if it is empty, or searching for an element, the overhead of creating that intermediate collection is unnecessary [1][2]. ### Examples of unnecessary collection Common cases flagged by this lint include: * Using.collect::<Vec<_>>().len()instead of.count()[1][2]. * Using.collect::<Vec<_>>().is_empty()instead of.next().is_none()[2][3]. * Using.collect::<Vec<_>>().contains(&x)instead of.any(|y| y == x)[2][3]. ### How to fix it In most cases, you can replace thecollect()call and the subsequent method with the equivalent iterator adapter or consumer [1][2]. For example: * Before:let len = iterator.collect::<Vec<_>>().len();* After:let len = iterator.count();### False Positives While the lint is highly effective, it may produce false positives in scenarios where the collected collection is required for multiple passes or reused throughout a function [4]. In such cases, if you determine that the collection is necessary for performance or logic, you can suppress the warning using an attribute:#[allow(clippy::needless_collect)][4] ### Technical Context The lint works by inspecting the abstract syntax tree (AST) for method call chains [2]. It specifically looks for patterns where acollectmethod is followed by common collection methods likelen,is_empty, orcontainson specific types (e.g.,Vec,VecDeque,LinkedList,BinaryHeap,HashMap,BTreeMap) [2]. When it detects these, it suggests a more efficient iterator-based alternative [2][3].Citations:
🏁 Script executed:
Repository: txpipe/dolos
Length of output: 32375
🌐 Web query:
site:github.com/rust-lang/rust-clippy "collect::<Vec<_>>().into_iter()" needless_collect💡 Result:
The pattern collect::<Vec<_>>.into_iter is flagged by the Clippy lint clippy::needless_collect because it frequently performs unnecessary heap allocations and data movement [1][2]. By collecting into a temporary vector only to iterate over it immediately, the code incurs the cost of allocating memory, copying or moving elements into the vector, and then freeing that memory, all of which can often be avoided by chaining iterator methods directly [1][3]. Clippy's needless_collect lint aims to identify these cases and suggest using the original iterator instead [1][2]. However, this lint is not always applicable and can produce false positives or incorrect suggestions [4][5][6]. It is important to evaluate if the collect is truly redundant, as it may serve specific purposes, such as: 1. Side effects: If the collection process itself (or the iterator before it) has essential side effects that must happen at a specific point in the execution, removing the collect will change program behavior [4]. 2. Borrowing and Ownership: Sometimes collecting is used to satisfy the borrow checker, resolve ownership issues, or work around lifetime constraints that would prevent direct iteration [1][6]. 3. Performance/Amortization: In some scenarios, such as when an iterator is reused multiple times (e.g., in a loop), collecting into a collection once might be more efficient than re-running a complex iterator pipeline multiple times [5]. 4. Semantic Requirements: Certain iterator methods or types require the collection to be materialized to function correctly (e.g., for specific ordering or deduplication logic) [1]. If you encounter this warning and determine the collect is necessary for any of these reasons, you can suppress the lint using #[allow(clippy::needless_collect)] on the affected expression or function [2][4].
Citations:
iter.collect::<Vec<_>>().into_iter()is useless and causes extra work rust-lang/rust-clippy#16101needless_collectwith borrowing error rust-lang/rust-clippy#9293🏁 Script executed:
Repository: txpipe/dolos
Length of output: 9660
🌐 Web query:
Rust Clippy needless_collect source collect into_iter map exact lint💡 Result:
The Clippy lint needless_collect warns when an iterator is collected into a temporary collection (like a Vec or HashMap) even though the final operation performed on that collection does not actually require the allocation [1]. Collecting into a collection incurs unnecessary performance costs—specifically memory allocation and data copying—when the desired result (such as length, emptiness, or existence checks) can be computed directly from the iterator [1]. Typical scenarios that trigger this lint include: - Calling.len on a collected collection instead of using.count on the iterator [2][1]. - Calling.is_empty on a collected collection instead of checking the iterator with.next.is_none [2]. - Calling.contains on a collected collection instead of using.any [2][1]. To resolve this warning, you should replace the.collect:: call and the subsequent collection method with the corresponding iterator adapter [1][3]. For example: - Replace iterator.collect::<Vec<>>.len with iterator.count [1]. - Replace iterator.collect::<Vec<>>.contains(&item) with iterator.any(|x| x == item) [2]. In some cases, especially when the collected collection is reused multiple times, Clippy may trigger a false positive [4]. If you need to keep the collection to avoid re-iterating (which would be more expensive than the allocation), you can suppress the lint for that specific block using: #[allow(clippy::needless_collect)] [4].
Citations:
🏁 Script executed:
Repository: txpipe/dolos
Length of output: 10079
🌐 Web query:
site:rust-lang.github.io/rust-clippy/master/index.html needless_collect💡 Result:
needless_collect is a lint provided by Clippy, the official Rust linter, that identifies cases where a collection is created from an iterator unnecessarily [1][2][3]. This lint triggers when you use.collect to create a temporary collection (such as a Vec) only to immediately iterate over it or check its length, when you could have simply iterated over the original iterator directly. Why it is bad: Creating a temporary collection involves unnecessary heap allocation, memory usage, and execution time. By consuming the iterator directly, you can perform the same operations without the overhead of materializing an intermediate collection [4]. Example: Instead of: let v: Vec<_> = iter.collect; v.iter.map(|x| x + 1).collect; You should use: iter.map(|x| x + 1).collect; In this scenario, Clippy will flag the initial.collect as needless_collect because the work could have been performed lazily on the iterator [1][4].
Citations:
Avoid the intermediate signer vector.
tx.required_signers()returnsMultiEraSigners, not an iterator. Usesigners.as_alonzo().into_iter().flat_map(|signers| signers.iter())before the existing mapping. A directsigners.map(...)call does not compile.🤖 Prompt for AI Agents
Source: Coding guidelines