Skip to content
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 Credentials and PermissionedDomain tx Support #1118

Merged
merged 26 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2af4952
fix: correct typo for website in english translation (#1101)
kennyzlei Dec 18, 2024
b0dc30d
basic structure of new transactions
achowdhry-ripple Jan 8, 2025
4c03487
simple tables completed
achowdhry-ripple Jan 14, 2025
d62f271
fix pr comments
achowdhry-ripple Jan 15, 2025
5bb90a3
domain tx and cred tests
achowdhry-ripple Jan 18, 2025
e6ce307
add permission domain set
achowdhry-ripple Jan 28, 2025
9522b3b
simple pages
achowdhry-ripple Jan 28, 2025
cf0cba3
tabledetail + cleanups
achowdhry-ripple Jan 29, 2025
7472ae5
tabledetails
achowdhry-ripple Jan 29, 2025
efbbce0
tabledetails for permissioneddomain
achowdhry-ripple Jan 29, 2025
e467ceb
add tx to translations
achowdhry-ripple Jan 29, 2025
6394624
remove unnecessary conditionals
achowdhry-ripple Jan 29, 2025
380bb42
cred accept tests
achowdhry-ripple Jan 29, 2025
3f22bd9
cred create tests
achowdhry-ripple Jan 29, 2025
3a91e81
cred delete tests
achowdhry-ripple Jan 29, 2025
f5ef32d
pdd and pds tx tests
achowdhry-ripple Jan 29, 2025
ef4c025
alias properties for clarity
achowdhry-ripple Jan 29, 2025
11982d1
typo
achowdhry-ripple Jan 30, 2025
91a0372
pull new version xrpl
achowdhry-ripple Feb 14, 2025
a88a448
lint
achowdhry-ripple Feb 14, 2025
0c4d960
remove extra file
achowdhry-ripple Feb 14, 2025
86894db
fix all tests
achowdhry-ripple Feb 20, 2025
7f208d9
add table details
achowdhry-ripple Feb 21, 2025
2beb933
Merge branch 'staging' into credentials
achowdhry-ripple Feb 21, 2025
9dcd5c1
convert expiration
achowdhry-ripple Feb 24, 2025
f15ed47
lint
achowdhry-ripple Feb 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 17 additions & 37 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"ts-jest": "^26.5.6",
"ts-node": "^10.9.2",
"typescript": "^4.9.5",
"xrpl": "^3.1.0"
"xrpl": "^4.1.0"
},
"resolutions": {
"jest-environment-jsdom": "29.3.1"
Expand Down
6 changes: 5 additions & 1 deletion public/locales/ca-CA/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -560,5 +560,9 @@
"search_results_banner": null,
"enable_amendment_name": null,
"amendment_status": null,
"expected_date": null
"expected_date": null,
"credential_type": null,
"subject": null,
"expiration": null,
"domain_id": null
}
12 changes: 10 additions & 2 deletions public/locales/en-US/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@
"transaction_type_name_CheckCancel": "Check Cancel",
"transaction_type_name_CheckCash": "Check Cash",
"transaction_type_name_CheckCreate": "Check Create",
"transaction_type_name_CredentialAccept": "Credential Accept",
"transaction_type_name_CredentialCreate": "Credential Create",
"transaction_type_name_CredentialDelete": "Credential Delete",
"transaction_type_name_DIDDelete": "DID Delete",
"transaction_type_name_DIDSet": "DID Set",
"transaction_type_name_DepositPreauth": "Deposit Preauth",
Expand Down Expand Up @@ -542,7 +545,7 @@
"deleted": "Deleted",
"holders": "HOLDERS: {{holders}}",
"trustlines": " TRUSTLINES: {{trustlines}}",
"website": "Wesbite",
"website": "Website",
"mpt_issuance_id": "MPT Issuance ID",
"asset_scale": "Asset Scale",
"metadata": "Metadata",
Expand All @@ -560,6 +563,11 @@
"search_results_banner": "Token search by name and account is now available! Try searching for USD",
"enable_amendment_name": "Amendment Name",
"amendment_status": "Amendment Status",
"expected_date": "Expected Date"
"expected_date": "Expected Date",
"credential_type": "Credential Type",
"subject": "Subject",
"expiration": "Expiration",
"domain_id": "Domain ID",
"accepted_credentials": "Accepted Credentials"

}
7 changes: 6 additions & 1 deletion public/locales/es-ES/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -556,5 +556,10 @@
"search_results_banner": null,
"enable_amendment_name": null,
"amendment_status": null,
"expected_date": null
"expected_date": null,
"credential_type": null,
"subject": null,
"expiration": null,
"domain_id": null,
"accepted_credentials": null
}
7 changes: 6 additions & 1 deletion public/locales/fr-FR/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -557,5 +557,10 @@
"search_results_banner": null,
"enable_amendment_name": null,
"amendment_status": null,
"expected_date": null
"expected_date": null,
"credential_type": null,
"subject": null,
"expiration": null,
"domain_id": null,
"accepted_credentials": null
}
7 changes: 6 additions & 1 deletion public/locales/ja-JP/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -556,5 +556,10 @@
"search_results_banner": null,
"enable_amendment_name": null,
"amendment_status": null,
"expected_date": null
"expected_date": null,
"credential_type": null,
"subject": null,
"expiration": null,
"domain_id": null,
"accepted_credentials": null
}
7 changes: 6 additions & 1 deletion public/locales/ko-KR/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -554,5 +554,10 @@
"search_results_banner": null,
"enable_amendment_name": null,
"amendment_status": null,
"expected_date": null
"expected_date": null,
"credential_type": null,
"subject": null,
"expiration": null,
"domain_id": null,
"accepted_credentials": null
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { useTranslation } from 'react-i18next'
import { type CredentialAccept } from 'xrpl'
import { TransactionSimpleComponent, TransactionSimpleProps } from '../types'
import { SimpleRow } from '../SimpleRow'
import { convertHexToString } from '../../../../../rippled/lib/utils'

const Simple: TransactionSimpleComponent = (
props: TransactionSimpleProps<CredentialAccept>,
) => {
const { t } = useTranslation()
const { data } = props
const { Account, Issuer, CredentialType } = data.instructions

return (
<>
{Account && (
<SimpleRow label={t('account')} data-test="account">
{Account}
</SimpleRow>
)}
{Issuer && (
<SimpleRow label={t('issuer')} data-test="issuer">
{Issuer}
</SimpleRow>
)}
{CredentialType && (
<SimpleRow label={t('credential_type')} data-test="credential-type">
{convertHexToString(CredentialType)}
</SimpleRow>
)}
</>
)
}

export { Simple }
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { useTranslation } from 'react-i18next'
import { type CredentialAccept } from 'xrpl'
import { TransactionTableDetailProps } from '../types'
import { convertHexToString } from '../../../../../rippled/lib/utils'

export const TableDetail = ({
instructions,
}: TransactionTableDetailProps<CredentialAccept>) => {
const { t } = useTranslation()
const { Account, Issuer, CredentialType } = instructions
return (
<div className="credentialAccept">
{Account && (
<div className="account">
<span className="label">{t('account')}: </span>
<span className="case-sensitive">{Account}</span>
</div>
)}
{Issuer && (
<div className="issuer">
<span className="label">{t('issuer')}: </span>
<span className="case-sensitive">{Issuer}</span>
</div>
)}
{CredentialType && (
<div className="credential-type">
<span className="label">{t('credential_type')}: </span>
<span className="case-sensitive">
{convertHexToString(CredentialType)}
</span>
</div>
)}
</div>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {
TransactionAction,
TransactionCategory,
TransactionMapping,
} from '../types'

import { Simple } from './Simple'

export const CredentialAcceptTransaction: TransactionMapping = {
Simple,
action: TransactionAction.MODIFY,
category: TransactionCategory.ACCOUNT,
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { createTableDetailWrapperFactory } from '../../test'
import { TableDetail } from '../TableDetail'
import mockCredentialAccept from './mock_data/CredentialAccept.json'

const createWrapper = createTableDetailWrapperFactory(TableDetail)

describe('CredentialAcceptTableDetail', () => {
it('renders CredentialAccept without crashing', () => {
const wrapper = createWrapper(mockCredentialAccept)

expect(wrapper.find('[data-test="account"]')).toHaveText(
` rLbgNAngLq3HABBXK4uPGCHrqeZwgaYi7q `,
)
expect(wrapper.find('[data-test="amount"]')).toHaveText(`997.50 XRP`)
expect(wrapper.find('[data-test="condition"]')).toHaveText(
` A0258020886F982742772F414243855DC13B348FC78FB3D5119412C8A6480114E36A4451810120 `,
)
expect(wrapper.find('[data-test="finish_after"]')).toHaveText(
`March 1, 2020 at 9:01:00 AM UTC`,
)
expect(wrapper.find('[data-test="cancel_after"]')).toHaveText(
`March 1, 2020 at 8:54:20 AM UTC`,
)

wrapper.unmount()
})
})
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { useTranslation } from 'react-i18next'
import { type CredentialCreate } from 'xrpl'
import { TransactionSimpleComponent, TransactionSimpleProps } from '../types'
import { SimpleRow } from '../SimpleRow'
import { convertHexToString } from '../../../../../rippled/lib/utils'

const Simple: TransactionSimpleComponent = (
props: TransactionSimpleProps<CredentialCreate>,
) => {
const { t } = useTranslation()
const { data } = props
const { Account, Subject, CredentialType, Expiration, URI } =
data.instructions

return (
<>
{Account && (
<SimpleRow label={t('account')} data-test="account">
{Account}
</SimpleRow>
)}
{Subject && (
<SimpleRow label={t('subject')} data-test="subject">
{Subject}
</SimpleRow>
)}
{CredentialType && (
<SimpleRow label={t('credential_type')} data-test="credential-type">
{convertHexToString(CredentialType)}
</SimpleRow>
)}
{Expiration && (
<SimpleRow label={t('expiration')} data-test="expiration">
{Expiration}
</SimpleRow>
)}
{URI && (
<SimpleRow label={t('uri')} data-test="uri">
{convertHexToString(URI)}
</SimpleRow>
)}
</>
)
}

export { Simple }
Loading
Loading