-
Notifications
You must be signed in to change notification settings - Fork 512
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
feat: Add optional CTID field to Tx #2477
Conversation
It seems like this change does not impact If you run this Request:
Response: (Contains
But if you run this Request:
Response: (No ctids)
As for the
Then pause the stream and search all results for @intelliot do you know if that is expected behavior? |
/** | ||
* The transaction hash to look up. Exactly one of `transaction` or `ctid` must be specified for a TxRequest. | ||
*/ | ||
transaction?: string | ||
/** | ||
* The Concise Transaction ID to look up. Exactly one of `transaction` or `ctid` must be specified for a TxRequest. | ||
*/ | ||
ctid?: 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.
This should be a more specific type to ensure that one of the two is provided.
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.
From what I saw when looking into this, I couldn't find a good way to ensure that one of the two was provided in a backwards compatible way.
The normal way "one of" is written is by combining multiple discrete types into a type alias, but then you can't initialize it like we do in snippets / a lot of code with Tx(...)
. So I don't think that path is worthwhile.
That problem is the same one with doing typing with meta types like this: https://stackoverflow.com/questions/40510611/typescript-interface-require-one-of-two-properties-to-exist
Any thoughts on how to ensure only one of the two is specified?
That's a good catch, and I would consider it to be a bug. Can you check if XRPLF/rippled#4738 fixes that? |
Going to merge & create a follow up issue to look at the response types for requests and add CTID to them :) |
High Level Overview of Change
Add a field for the Concise Transaction ID that was added in rippled 1.12
Fixes #2409
Context of Change
Added to rippled via: XRPLF/rippled#4418
Type of Change
Did you update HISTORY.md?
Test Plan
CI Passes