-
Notifications
You must be signed in to change notification settings - Fork 97
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
View XDR stream + update Trezor deps #1178
base: master
Are you sure you want to change the base?
Conversation
Preview is available here: |
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.
LGTM with one question/suggestion
src/app/(sidebar)/xdr/view/page.tsx
Outdated
json={parseToLosslessJson(xdrJsonDecoded.jsonString)} | ||
xdr={xdr.blob} | ||
/> | ||
{xdrJsonDecoded?.jsonArray?.map((j, index) => ( |
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.
Should it be array of Json objects instead of array of PrettyJsonTransaction
?
I think it would be a bit more user friendly, currently I have
{
"function_v0": {...}
}
{
"function_v0":{...}
}
Which is not a valid JSON (so you can't just pass it to any of JSON parsers). Instead, maybe we can out a valid JSON array of
[
{
"function_v0": {...}
},
{
"function_v0":{...}
}
]
WDYT?
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.
Thanks for pointing this out. I'll update it to display it as a proper array of JSON objects.
Note: To get the correct JSON, you should use the "Copy JSON" button (uses direct response without any modification). We have extra elements in the UI that will make the JSON invalid if you select and copy it.
Preview is available here: |
<div className="PrettyJson PrettyJson__array"> | ||
<div className="PrettyJson__inline"> | ||
<span className="PrettyJson__bracket">[</span> | ||
<span className="PrettyJson__expandSize">{`${jsonArray.length} items`}</span> | ||
</div> | ||
{jsonArray.map((j, index) => ( | ||
<> | ||
<PrettyJsonTransaction | ||
// Using index here because we can't get something unique from the JSON | ||
key={`pretty-json-${index}`} | ||
json={j} | ||
xdr={xdr} | ||
/> | ||
</> | ||
))} | ||
<span className="PrettyJson__bracket">]</span> | ||
</div> |
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.
Handling the array styling manually here because it's the only place where we have it. If we need it someplace else, we'll create a component for it.
XDR stream example
Type
ScSpecEntry
XDR