-
Notifications
You must be signed in to change notification settings - Fork 59
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 OracleSet and OracleDelete transactions #983
Conversation
src/containers/shared/components/Transaction/OracleDelete/Simple.tsx
Outdated
Show resolved
Hide resolved
src/containers/shared/components/Transaction/OracleSet/Simple.tsx
Outdated
Show resolved
Hide resolved
return ( | ||
<div className="oracle-delete"> | ||
{ | ||
// OracleDocumentID could be zero. |
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 can be a TODO for a future PR, but do you think it'd be useful to have info here about the oracle that's being deleted?
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.
People seem to ask about way we could filter tx by OracleDocumentID
so I deemed that showing the ID might be important
src/containers/shared/components/Transaction/OracleDelete/Simple.tsx
Outdated
Show resolved
Hide resolved
src/containers/shared/components/Transaction/OracleDelete/TableDetail.tsx
Outdated
Show resolved
Hide resolved
src/containers/shared/components/Transaction/OracleDelete/TableDetail.tsx
Outdated
Show resolved
Hide resolved
src/containers/shared/components/Transaction/OracleSet/Simple.tsx
Outdated
Show resolved
Hide resolved
src/containers/shared/components/Transaction/OracleSet/parser.ts
Outdated
Show resolved
Hide resolved
<span className="case-sensitive">{priceDataObj.assetPrice}</span> | ||
</> | ||
)} | ||
{index < tx.priceDataSeries.length - 1 && ', '} |
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 like 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.
LGTM 👍
src/containers/shared/components/Transaction/OracleSet/test/ConvertScalePrice.test.js
Outdated
Show resolved
Hide resolved
src/containers/shared/components/Transaction/OracleSet/test/OracleSetSimple.test.js
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,12 @@ | |||
import { createSimpleWrapperFactory, expectSimpleRowText } from '../../test' |
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.
The tests that are testing React components should use .test.tsx
as their file ending.
|
||
// Convert scaled price (assetPrice) to original price using formula: | ||
// originalPrice = assetPrice / 10**scale | ||
// More details: https://github.com/XRPLF/XRPL-Standards/discussions/129 |
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 link to the published standard, not the discussion: https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-47d-PriceOracles
|
||
describe('convertScaledPrice', () => { | ||
it('should convert scaled price to original price correctly using scale factor', () => { | ||
// scaled price: 5083 |
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.
If you want this to be easier to read (and avoid the need for a comment), you can convert the numbers to hex in the test itself instead of just using the hex
High Level Overview of Change
Title said it all.
Context of Change
PriceOracle amendment:
XRPLF/XRPL-Standards#129
Type of Change
Before / After
OracleSet transaction page:
OracleDelete transaction page:
Table Detail view: