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

Add filter start and end support #5651

Merged
merged 3 commits into from
Nov 13, 2024
Merged

Conversation

NullSoldier
Copy link
Contributor

Summary

This lets you filter dates based on a date input such as 04/20/2023

Testing Plan

ironfish wallet:transactions --no-account --filter.start 09/1/2024 --filter.end 10/01/2024

Documentation

Does this change require any updates to the Iron Fish Docs (ex. the RPC API
Reference
)? If yes, link a
related documentation pull request for the website.

[ ] Yes

Breaking Change

Is this a breaking change? If yes, add notes below on why this is breaking and label it with breaking-change-rpc or breaking-change-sdk.

[ ] Yes

This lets you filter dates based on a date input such as 04/20/2023
@NullSoldier NullSoldier requested a review from a team as a code owner November 13, 2024 23:07
@@ -62,6 +62,14 @@ export class TransactionsCommand extends IronfishCommand {
options: ['notes', 'transactions', 'transfers'],
helpGroup: 'OUTPUT',
}),
'filter.start': Flags.string({
description: 'include transactions after this date (inclusive). Example: 04/20/2023',
parse: (input) => Promise.resolve(new Date(input).toISOString()),
Copy link
Contributor

Choose a reason for hiding this comment

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

input gets converted to a Date, then to an ISO string, then back to a Date, then to an integer. I wonder if we could just remove the .toISOString() here and have this parse function return a Date?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You need to create a new custom flag for this that supports dates. I can do this but I'll need to open a separate Pr that will then block this. I can start working on that now but it's outside the goal of this individual PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll work on adding this

Copy link
Contributor

Choose a reason for hiding this comment

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

No need to add this functionality as far as I'm concerned--I was just wondering if it was possible. I was assuming that parse could return any type

Comment on lines 65 to 69
'filter.start': Flags.string({
description: 'include transactions after this date (inclusive). Example: 04/20/2023',
parse: (input) => Promise.resolve(new Date(input).toISOString()),
}),
'filter.end': Flags.string({
Copy link
Contributor

Choose a reason for hiding this comment

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

nit - should the names for these be more date-specific? start and end could also refer to sequences. I suppose we could handle that if/when we ever add filtering on sequence

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: before/after

@NullSoldier NullSoldier merged commit a5afca5 into staging Nov 13, 2024
12 checks passed
@NullSoldier NullSoldier deleted the jason/filter-start-end branch November 13, 2024 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants