Skip to content

Commit

Permalink
Rename MPTokenHolder to Holder (#1062)
Browse files Browse the repository at this point in the history
## High Level Overview of Change
rippled change that renames MPTokenHolder:
XRPLF/rippled@b636836
<!--
Please include a summary/list of the changes.
If too broad, please consider splitting into multiple PRs.
-->

### Context of Change

<!--
Please include the context of a change.
If a bug fix, when was the bug introduced? What was the behavior?
If a new feature, why was this architecture chosen? What were the
alternatives?
If a refactor, how is this better than the previous implementation?

If there is a design document for this feature, please link it here.
-->

### Type of Change

<!--
Please check relevant options, delete irrelevant ones.
-->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [x] Refactor (non-breaking change that only restructures code)
- [ ] Tests (You added tests for code that already exists, or your new
feature included in this PR)
- [ ] Documentation Updates
- [ ] Translation Updates
- [ ] Release

### TypeScript/Hooks Update

<!--
In an effort to modernize the codebase, you should convert the files
that you work with to React Hooks and TypeScript.
If this is not possible (e.g. it's too many changes, touching too many
files, etc.) please explain why here.
-->

- [ ] Updated files to React Hooks
- [ ] Updated files to TypeScript

## Before / After

<!--
If just refactoring / back-end changes, this can be just an in-English
description of the change at a technical level.
If a UI change, screenshots should be included.
-->

## Test Plan

<!--
Please describe the tests that you ran to verify your changes and
provide instructions so that others can reproduce.
-->

<!--
## Future Tasks
For future tasks related to PR.
-->
  • Loading branch information
shawnxie999 authored Dec 16, 2024
1 parent 8cdbf05 commit 4028046
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { formatAmount } from '../../../../../rippled/lib/txSummary/formatAmount'
export const Description = ({ data }: TransactionDescriptionProps) => {
const issuer = data.tx.Account
const amount = formatAmount(data.tx.Amount)
const holder = amount.isMPT ? data.tx.MPTokenHolder : data.tx.Amount.issuer
const holder = amount.isMPT ? data.tx.Holder : data.tx.Amount.issuer
amount.issuer = issuer
return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const parser: TransactionParser<Clawback, ClawbackInstructions> = (
const amount = formatAmount(tx.Amount)

if (amount.isMPT === true) {
const holder = tx.MPTokenHolder
const holder = tx.Holder

const filteredMptNode = meta.AffectedNodes.filter(
(node: any) => node.ModifiedNode?.LedgerEntryType === 'MPToken',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"Fee": "10",
"Flags": 2147483648,
"MPTokenHolder": "rUZTPFN7MBJkjiZ48rak6q7MbhT4ur2kAD",
"Holder": "rUZTPFN7MBJkjiZ48rak6q7MbhT4ur2kAD",
"Sequence": 3432,
"SigningPubKey": "ED0C1DE70A8762E6C98EC78CF13D278D6950ECDFE8E87BAD3732730845E2D9AB6A",
"TransactionType": "Clawback",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"Fee": "10",
"Flags": 2147483648,
"MPTokenHolder": "r9rAqX8Jjo4uACsimYDVsy5thHDPivujqf",
"Holder": "r9rAqX8Jjo4uACsimYDVsy5thHDPivujqf",
"Sequence": 4246,
"SigningPubKey": "ED4F6FF2241860884D4DD6C5797BDA553155D194F07B1BFC67129F183322DA7DC3",
"TransactionType": "Clawback",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Amount, ExplorerAmount } from '../../../types'

export interface Clawback extends TransactionCommonFields {
Amount: Amount
MPTokenHolder?: string
Holder?: string
}

export interface ClawbackInstructions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ import { MPTokenLink } from '../../MPTokenLink'
export const Simple: TransactionSimpleComponent = ({
data,
}: TransactionSimpleProps<MPTokenAuthorize>) => {
const { MPTokenIssuanceID, MPTokenHolder } = data.instructions
const { MPTokenIssuanceID, Holder } = data.instructions
const { t } = useTranslation()

return (
<>
<SimpleRow label={t('mpt_issuance_id')} data-test="mpt-issuance-id">
<MPTokenLink tokenID={MPTokenIssuanceID} />
</SimpleRow>
{MPTokenHolder && (
{Holder && (
<SimpleRow label={t('mpt_holder')} data-test="mpt-holder">
<Account account={MPTokenHolder} />
<Account account={Holder} />
</SimpleRow>
)}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"Account": "rwfgw2dWqUAexB46z5QRq2dJcgTK9piw5w",
"Fee": "10",
"Flags": 2147483648,
"MPTokenHolder": "rK3bB9myvWoMaLbLnpksGx2Zz58BL225am",
"Holder": "rK3bB9myvWoMaLbLnpksGx2Zz58BL225am",
"MPTokenIssuanceID": "0000130B63FC523E33FDF4D1318D8D484B0D1111098CFD0B",
"Sequence": 4876,
"SigningPubKey": "ED936E848B8E37D20991C2E1C5C76ABAEC0625D693CEB85BA495B58E16712DA627",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"Account": "rL4pMQAa3V7s9QNw1wEk2znnhjbfYo4GQC",
"Fee": "10",
"Flags": 2147483648,
"MPTokenHolder": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"Holder": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"MPTokenIssuanceID": "00000F76D46440EE21F74E5B2398315BC1CFEB9A7EB48A14",
"Sequence": 3959,
"SigningPubKey": "EDF7A3D93CE3AA46168649283C20C2D4FC36642FDD87449F1CCF068638BF17B10E",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import { TransactionCommonFields } from '../types'

export interface MPTokenAuthorize extends TransactionCommonFields {
MPTokenIssuanceID: string
MPTokenHolder?: string
Holder?: string
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ import { MPTokenLink } from '../../MPTokenLink'
export const Simple: TransactionSimpleComponent = ({
data,
}: TransactionSimpleProps<MPTokenIssuanceSet>) => {
const { MPTokenIssuanceID, MPTokenHolder } = data.instructions
const { MPTokenIssuanceID, Holder } = data.instructions
const { t } = useTranslation()

return (
<>
<SimpleRow label={t('mpt_issuance_id')} data-test="mpt-issuance-id">
<MPTokenLink tokenID={MPTokenIssuanceID} />
</SimpleRow>
{MPTokenHolder && (
{Holder && (
<SimpleRow label={t('mpt_holder')} data-test="mpt-holder">
<Account account={MPTokenHolder} />
<Account account={Holder} />
</SimpleRow>
)}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"Account": "rERyS9qtwky94UMMjjmbku3uo5aQwAoJ58",
"Fee": "10",
"Flags": 1,
"MPTokenHolder": "r9hF4e3e6kLuxLobPwfQa2wzXZMDvBDeUg",
"Holder": "r9hF4e3e6kLuxLobPwfQa2wzXZMDvBDeUg",
"MPTokenIssuanceID": "00000BED9E4ADA3DCC1BE78683C4B623A74013818160590C",
"Sequence": 3054,
"SigningPubKey": "EDF73A1C528F5BFBD6FF2B05D0C71760D7D2DF1DE3496935612E47BCB440F28040",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"Account": "rpizWPf4g8JLWFUT7143Zn9A1n2Dy9bnji",
"Fee": "10",
"Flags": 1,
"MPTokenHolder": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"Holder": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"MPTokenIssuanceID": "00000F83146C83112AED215CD345F8E7327459BFCF6B8062",
"Sequence": 3972,
"SigningPubKey": "ED4EC06184C745D99AEAAA16526C900DC181C8546899F462C3D105C11A6677A65A",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import { TransactionCommonFields } from '../types'

export interface MPTokenIssuanceSet extends TransactionCommonFields {
MPTokenIssuanceID: string
MPTokenHolder?: string
Holder?: string
}

0 comments on commit 4028046

Please sign in to comment.