-
Notifications
You must be signed in to change notification settings - Fork 77
feat: Add delegate filter param's to account_tx RPC #2827
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
base: develop
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #2827 +/- ##
===========================================
+ Coverage 81.84% 81.92% +0.07%
===========================================
Files 381 383 +2
Lines 14423 14504 +81
Branches 7933 7978 +45
===========================================
+ Hits 11805 11882 +77
- Misses 1447 1448 +1
- Partials 1171 1174 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| if (delegateFilter.has_value()) { | ||
| resultTxns.reserve(txns.size()); | ||
|
|
||
| for (auto& txn : txns) { |
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.
Looks like a good place to try and use ranges? 🙂
|
|
||
| auto const& type = delegateType.as_string(); | ||
|
|
||
| if (type == "delegator") |
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.
Magic strings everywhere 😃 these should either be JS(...) if possible or some sort of constants 🔢
src/rpc/common/Types.hpp
Outdated
| * @brief A delegate type used in delegate filter | ||
| */ | ||
| enum class Role { | ||
| // This account is the *active* sender, acting on behalf of another party. |
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.
This could be part of doxygen, perhaps with a trailing comment style
This PR adds the ability to filter account_tx results based on transaction delegation. This is useful for scenarios where one account (the delegatee) signs and submits a transaction on behalf of another account (the delegator).
New Request Parameter:
Example: If User A submits a transaction to C on behalf of B:
User B (The account holder) can query with delegate_filter: "delegatee" to find transactions signed by others (like User A).
User A (The signer) can query with delegate_filter: "delegator" to find transactions they signed for others (like User B).
The counter_party field can be used in either case to filter by a specific valid address