-
Notifications
You must be signed in to change notification settings - Fork 572
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
Conversation
This lets you filter dates based on a date input such as 04/20/2023
@@ -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()), |
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.
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?
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.
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.
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.
I'll work on adding this
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.
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
'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({ |
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.
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
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.
Suggestion: before/after
Summary
This lets you filter dates based on a date input such as 04/20/2023
Testing Plan
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.
Breaking Change
Is this a breaking change? If yes, add notes below on why this is breaking and label it with
breaking-change-rpc
orbreaking-change-sdk
.