Skip to content

Commit

Permalink
Merge branch 'rtl' into data-testid
Browse files Browse the repository at this point in the history
  • Loading branch information
mvadari authored Jul 5, 2024
2 parents ae53a7c + 257770d commit fe02b33
Show file tree
Hide file tree
Showing 31 changed files with 2,188 additions and 1,147 deletions.
2,682 changes: 1,553 additions & 1,129 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,31 +42,31 @@
"react-query": "^3.39.3",
"react-redux": "^8.1.3",
"react-router": "^6.12.1",
"react-router-dom": "^6.18.0",
"react-router-dom": "^6.24.0",
"react18-json-view": "^0.2.7",
"recharts": "^2.12.6",
"redux": "^5.0.1",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.2.0",
"ripple-address-codec": "^5.0.0-beta.1",
"ripple-address-codec": "^5.0.0",
"topojson-client": "^3.0.0",
"usehooks-ts": "^2.9.1",
"usehooks-ts": "^3.1.0",
"vite": "^4.2.3",
"vite-plugin-environment": "^1.1.3",
"vite-plugin-html": "^3.2.0",
"vite-plugin-svgr": "^4.2.0",
"vite-tsconfig-paths": "^4.2.0",
"xrpl-client": "^2.1.0"
"xrpl-client": "^2.4.0"
},
"devDependencies": {
"@babel/eslint-parser": "^7.22.6",
"@babel/preset-env": "^7.24.5",
"@babel/preset-react": "^7.22.15",
"@babel/preset-react": "^7.24.7",
"@types/create-hash": "^1.2.2",
"@types/enzyme": "^3.10.12",
"@types/jest": "^26.0.24",
"@types/lodash": "^4.14.194",
"@types/node": "^18.19.31",
"@types/lodash": "^4.17.6",
"@types/node": "^18.19.33",
"@types/react": "^17.0.39",
"@types/react-dom": "^17.0.9",
"@types/react-redux": "^7.1.22",
Expand All @@ -86,11 +86,11 @@
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react": "^7.34.2",
"eslint-plugin-react-hooks": "^4.6.0",
"jest-enzyme": "^7.1.0",
"jest-websocket-mock": "^2.5.0",
"lint-staged": "^15.1.0",
"lint-staged": "^15.2.5",
"mock-socket": "^9.1.5",
"moxios": "^0.4.0",
"nodemon": "^3.0.1",
Expand Down
10 changes: 9 additions & 1 deletion public/locales/ca-CA/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@
"transaction_type_name_NFTokenMint": "Encunyar NFT",
"transaction_type_name_OfferCancel": "Cancel·lar Oferta",
"transaction_type_name_OfferCreate": "Crear Ofertae",
"transaction_type_name_OracleDelete": null,
"transaction_type_name_OracleSet": null,
"transaction_type_name_Payment": "Pagament",
"transaction_type_name_PaymentChannelClaim": "Reclamar al Canal de Pagament",
"transaction_type_name_PaymentChannelCreate": "Crear Canal de Pagament",
Expand Down Expand Up @@ -522,5 +524,11 @@
"note": "Nota",
"indicate_unl": "indica un validador en una UNL",
"transaction_tokens_involved": "<Currency/> i <Currency2/>",
"transaction_tokens_swapped": "<Currency/> per <Currency2/>"
"transaction_tokens_swapped": "<Currency/> per <Currency2/>",
"oracle_document_id": null,
"provider": null,
"last_update_time": null,
"asset_class": null,
"trading_pairs": null,
"deleted": null
}
10 changes: 9 additions & 1 deletion public/locales/en-US/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@
"transaction_type_name_NFTokenMint": "NFT Mint",
"transaction_type_name_OfferCancel": "Offer Cancel",
"transaction_type_name_OfferCreate": "Offer Create",
"transaction_type_name_OracleDelete": "Oracle Delete",
"transaction_type_name_OracleSet": "Oracle Set",
"transaction_type_name_Payment": "Payment",
"transaction_type_name_PaymentChannelClaim": "Payment Channel Claim",
"transaction_type_name_PaymentChannelCreate": "Payment Channel Create",
Expand Down Expand Up @@ -522,5 +524,11 @@
"note": "Note",
"indicate_unl": "indicates a validator on an UNL",
"transaction_tokens_involved": "<Currency/> and <Currency2/>",
"transaction_tokens_swapped": "<Currency/> for <Currency2/>"
"transaction_tokens_swapped": "<Currency/> for <Currency2/>",
"oracle_document_id": "Oracle Document ID",
"provider": "Provider",
"last_update_time": "Last Update Time",
"asset_class": "Asset Class",
"trading_pairs": "Trading Pairs",
"deleted": "Deleted"
}
10 changes: 9 additions & 1 deletion public/locales/es-ES/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@
"transaction_type_name_NFTokenMint": "Acuñar NFT",
"transaction_type_name_OfferCancel": "Cancelar Oferta",
"transaction_type_name_OfferCreate": "Crear Oferta",
"transaction_type_name_OracleDelete": null,
"transaction_type_name_OracleSet": null,
"transaction_type_name_Payment": "Pago",
"transaction_type_name_PaymentChannelClaim": "Reclamar Canal de Pago",
"transaction_type_name_PaymentChannelCreate": "Crear Canal de Pago",
Expand Down Expand Up @@ -518,5 +520,11 @@
"note": "Nota",
"indicate_unl": "indica a un validador en una UNL",
"transaction_tokens_involved": "<Currency/> y <Currency2/>",
"transaction_tokens_swapped": "<Currency/> por <Currency2/>"
"transaction_tokens_swapped": "<Currency/> por <Currency2/>",
"oracle_document_id": null,
"provider": null,
"last_update_time": null,
"asset_class": null,
"trading_pairs": null,
"deleted": null
}
10 changes: 9 additions & 1 deletion public/locales/fr-FR/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@
"transaction_type_name_NFTokenMint": "NFT forgé",
"transaction_type_name_OfferCancel": "Offre annulée",
"transaction_type_name_OfferCreate": "Offre créée",
"transaction_type_name_OracleDelete": null,
"transaction_type_name_OracleSet": null,
"transaction_type_name_Payment": "Paiement effectué",
"transaction_type_name_PaymentChannelClaim": "Canal de paiement réclamé",
"transaction_type_name_PaymentChannelCreate": "Canal de paiement créé",
Expand Down Expand Up @@ -519,5 +521,11 @@
"note": null,
"indicate_unl": null,
"transaction_tokens_involved": null,
"transaction_tokens_swapped": null
"transaction_tokens_swapped": null,
"oracle_document_id": null,
"provider": null,
"last_update_time": null,
"asset_class": null,
"trading_pairs": null,
"deleted": null
}
10 changes: 9 additions & 1 deletion public/locales/ja-JP/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@
"transaction_type_name_NFTokenMint": "NFTのミント",
"transaction_type_name_OfferCancel": "オファーの取消",
"transaction_type_name_OfferCreate": "オファーの作成",
"transaction_type_name_OracleDelete": null,
"transaction_type_name_OracleSet": null,
"transaction_type_name_Payment": "支払い",
"transaction_type_name_PaymentChannelClaim": "ペイメントチャネル請求",
"transaction_type_name_PaymentChannelCreate": "ペイメントチャネル作成",
Expand Down Expand Up @@ -518,5 +520,11 @@
"note": null,
"indicate_unl": null,
"transaction_tokens_involved": null,
"transaction_tokens_swapped": null
"transaction_tokens_swapped": null,
"oracle_document_id": null,
"provider": null,
"last_update_time": null,
"asset_class": null,
"trading_pairs": null,
"deleted": null
}
10 changes: 9 additions & 1 deletion public/locales/ko-KR/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@
"transaction_type_name_NFTokenMint": "NFT 발행",
"transaction_type_name_OfferCancel": "제안 취소",
"transaction_type_name_OfferCreate": "제안 생성",
"transaction_type_name_OracleDelete": null,
"transaction_type_name_OracleSet": null,
"transaction_type_name_PaymentChannelClaim": "결제 채널 청구",
"transaction_type_name_PaymentChannelCreate": "결제 채널 생성",
"transaction_type_name_PaymentChannelFund": "결제 채널 펀딩",
Expand Down Expand Up @@ -516,5 +518,11 @@
"note": null,
"indicate_unl": null,
"transaction_tokens_involved": null,
"transaction_tokens_swapped": null
"transaction_tokens_swapped": null,
"oracle_document_id": null,
"provider": null,
"last_update_time": null,
"asset_class": null,
"trading_pairs": null,
"deleted": null
}
3 changes: 3 additions & 0 deletions src/containers/Token/TokenHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ const TokenHeader = ({
flags && flags.includes('lsfRequireAuth') ? 'true' : 'false'
const requireDestTag =
flags && flags.includes('lsfRequireDestTag') ? 'true' : 'false'
const clawback =
flags && flags.includes('lsfAllowTrustLineClawback') ? 'true' : 'false'

return (
<table className="token-table">
Expand All @@ -136,6 +138,7 @@ const TokenHeader = ({
<TokenTableRow label="No freeze" value={noFreeze} />
<TokenTableRow label="Require Auth" value={requireAuth} />
<TokenTableRow label="Require Dest Tag" value={requireDestTag} />
<TokenTableRow label="Allow TrustLine Clawback" value={clawback} />
</tbody>
</table>
)
Expand Down
9 changes: 9 additions & 0 deletions src/containers/Transactions/simpleTab.scss
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@ $subdued-color: $black-40;
vertical-align: bottom;
}
}

&.list {
margin-bottom: 12px;

.one-line {
justify-content: flex-end;
margin: -1px 0px 0px;
}
}
}

ul {
Expand Down
2 changes: 1 addition & 1 deletion src/containers/shared/amendmentUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function getExpectedDate(date: string, language: string) {

async function fetchAmendmentNames() {
const response = await axios.get(
'https://raw.githubusercontent.com/ripple/rippled/develop/src/ripple/protocol/impl/Feature.cpp',
'https://raw.githubusercontent.com/XRPLF/rippled/develop/src/libxrpl/protocol/Feature.cpp',
)
const text = response.data

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { useTranslation } from 'react-i18next'
import { TransactionSimpleComponent, TransactionSimpleProps } from '../types'
import { SimpleRow } from '../SimpleRow'

export const Simple: TransactionSimpleComponent = ({
data,
}: TransactionSimpleProps) => {
const { t } = useTranslation()
const { OracleDocumentID } = data.instructions
return (
<SimpleRow label={t('oracle_document_id')} data-test="oracle-document-id">
{OracleDocumentID}
</SimpleRow>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { useTranslation } from 'react-i18next'
import { TransactionTableDetailProps } from '../types'
import { OracleDelete } from './types'

export const TableDetail = ({
instructions: tx,
}: TransactionTableDetailProps<OracleDelete>) => {
const { t } = useTranslation()
return (
<div className="oracle-document-id">
<span className="label">{t('oracle_document_id')}: </span>
<span className="case-sensitive">{tx.OracleDocumentID}</span>
</div>
)
}
15 changes: 15 additions & 0 deletions src/containers/shared/components/Transaction/OracleDelete/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import {
TransactionAction,
TransactionCategory,
TransactionMapping,
} from '../types'

import { Simple } from './Simple'
import { TableDetail } from './TableDetail'

export const OracleDeleteTransaction: TransactionMapping = {
Simple,
TableDetail,
action: TransactionAction.CANCEL,
category: TransactionCategory.DEX,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { createSimpleWrapperFactory, expectSimpleRowText } from '../../test'
import { Simple } from '../Simple'
import OracleDelete from './mock_data/OracleDelete.json'

const createWrapper = createSimpleWrapperFactory(Simple)
describe('OracleDelete: Simple', () => {
it('renders', () => {
const wrapper = createWrapper(OracleDelete)
expectSimpleRowText(wrapper, 'oracle-document-id', '1')
wrapper.unmount()
})
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { createTableDetailWrapperFactory } from '../../test'
import { TableDetail } from '../TableDetail'
import OracleDelete from './mock_data/OracleDelete.json'

const createWrapper = createTableDetailWrapperFactory(TableDetail)

describe('OracleDelete: TableDetail', () => {
it('renders', () => {
const wrapper = createWrapper(OracleDelete)
expect(wrapper).toHaveText('oracle_document_id: 1')
wrapper.unmount()
})
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
"tx": {
"Account": "rnuj2NkRxGbGpUK8u9hqEJA1zGRWyxHGvC",
"Fee": "10",
"Flags": 0,
"LastLedgerSequence": 670056,
"OracleDocumentID": 1,
"Sequence": 670033,
"SigningPubKey": "ED9376FE6E9063CB291C1031FC07A3B349D9FC45F2D71001B9CC7318F32C3A8F72",
"TransactionType": "OracleDelete",
"TxnSignature": "B1BD6A7AA9A0B3779D4EBE0652931D22792931B2F853C38E14BCFC2FD981FF3AFAA4921748B0321C8F0088180703425A8421606FCAFA028BF09F6E9A636DEC0D",
"ctid": "C00A395600000002",
"date": 768949530,
"inLedger": 670038,
"ledger_index": 670038
},
"meta": {
"AffectedNodes": [
{
"ModifiedNode": {
"FinalFields": {
"Account": "rnuj2NkRxGbGpUK8u9hqEJA1zGRWyxHGvC",
"Balance": "99999970",
"Flags": 0,
"OwnerCount": 0,
"Sequence": 670034
},
"LedgerEntryType": "AccountRoot",
"LedgerIndex": "05CC65869680974EF73B8C16A8D59DE7CE9C6B3B012328B11FCC28232B552EA6",
"PreviousFields": {
"Balance": "99999980",
"OwnerCount": 1,
"Sequence": 670033
},
"PreviousTxnID": "F5729FD72193989887718F13A28F2F8A33C03FD8299DC0C00F9952B28C8DA7EA",
"PreviousTxnLgrSeq": 670036
}
},
{
"DeletedNode": {
"FinalFields": {
"AssetClass": "63757272656E6379",
"Flags": 0,
"LastUpdateTime": 1715634318,
"Owner": "rnuj2NkRxGbGpUK8u9hqEJA1zGRWyxHGvC",
"OwnerNode": "0",
"PreviousTxnID": "F5729FD72193989887718F13A28F2F8A33C03FD8299DC0C00F9952B28C8DA7EA",
"PreviousTxnLgrSeq": 670036,
"PriceDataSeries": [
{
"PriceData": {
"AssetPrice": "67",
"BaseAsset": "BTC",
"QuoteAsset": "EUR",
"Scale": 2
}
},
{
"PriceData": {
"AssetPrice": "2e6",
"BaseAsset": "XRP",
"QuoteAsset": "USD",
"Scale": 1
}
}
],
"Provider": "70726F7669646572"
},
"LedgerEntryType": "Oracle",
"LedgerIndex": "2E0AC1D6AFC11AD78E48BE575761F75C0326F0547EE178CBB5D67F61691E13E7"
}
},
{
"ModifiedNode": {
"FinalFields": {
"Flags": 0,
"Owner": "rnuj2NkRxGbGpUK8u9hqEJA1zGRWyxHGvC",
"RootIndex": "D745822C67049231E61684BF1F68DACFE522A3172FE4B635FE3966B218E90E2F"
},
"LedgerEntryType": "DirectoryNode",
"LedgerIndex": "D745822C67049231E61684BF1F68DACFE522A3172FE4B635FE3966B218E90E2F"
}
}
],
"TransactionIndex": 0,
"TransactionResult": "tesSUCCESS"
},
"hash": "DEBA9881129F2191619045FC07B294107342410BF4E447CEEB801BFC75CC2342",
"ledger_index": 670038,
"date": 768949530
}
Loading

0 comments on commit fe02b33

Please sign in to comment.