Skip to content

Commit 5c0623c

Browse files
committed
refactor: removed unused clawback field for asset opt-in txn
1 parent 4b785ff commit 5c0623c

File tree

3 files changed

+0
-14
lines changed

3 files changed

+0
-14
lines changed

src/features/transaction-wizard/components/asset-opt-in-transaction-builder.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ export const assetOptInFormSchema = z.object({
3232
id: bigIntSchema(z.bigint({ required_error: 'Required', invalid_type_error: 'Required' }).min(1n)),
3333
decimals: z.number().optional(),
3434
unitName: z.string().optional(),
35-
clawback: z.string().optional(),
3635
})
3736
.superRefine((asset, ctx) => {
3837
if (asset.decimals === undefined) {
@@ -106,7 +105,6 @@ function FormFieldsWithAssetInfo({ helper, formCtx, assetId }: FieldsWithAssetIn
106105
if ((initialAssetLoad && getValues('asset.decimals') === undefined) || !initialAssetLoad) {
107106
setValue('asset.decimals', loadableAssetSummary.state === 'hasData' ? loadableAssetSummary.data.decimals : undefined)
108107
setValue('asset.unitName', loadableAssetSummary.state === 'hasData' ? loadableAssetSummary.data.unitName : undefined)
109-
setValue('asset.clawback', loadableAssetSummary.state === 'hasData' ? loadableAssetSummary.data.clawback : undefined)
110108
trigger('asset')
111109
}
112110
if (initialAssetLoad) {

src/features/transaction-wizard/utils/transactions-url-search-params.test.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,6 @@ describe('Render transactions page with search params', () => {
479479
const assetId = '12345'
480480
const decimals = '6'
481481
const unitName = 'USDC'
482-
const clawback = 'AAOLENX3Z76HBMQOLQF4VW26ZQSORVX7ZQJ66LCPX36T2QNAUYOYEY76RM'
483482
const fee = '2000'
484483
const note = 'Asset opt-in test'
485484

@@ -506,7 +505,6 @@ describe('Render transactions page with search params', () => {
506505
'assetid[0]': assetId,
507506
'decimals[0]': decimals,
508507
'unitname[0]': unitName,
509-
'clawback[0]': clawback,
510508
'fee[0]': fee,
511509
'note[0]': note,
512510
}),
@@ -516,8 +514,6 @@ describe('Render transactions page with search params', () => {
516514
expect(screen.getAllByText(sender)).toHaveLength(2)
517515
expect(screen.getByText(assetId)).toBeInTheDocument()
518516
expect(screen.getByText(`0 ${unitName}`)).toBeInTheDocument()
519-
// Clawback is not displayed in the UI, nor in the edit form. WHY?
520-
// expect(screen.getByText(clawback)).toBeInTheDocument()
521517
expect(screen.getByText('0.002')).toBeInTheDocument()
522518
expect(screen.getByText(note)).toBeInTheDocument()
523519
})
@@ -612,13 +608,6 @@ describe('Render transactions page with search params', () => {
612608
value: '-1',
613609
expected: 'Error in transaction at index 0 in the following fields: asset-id',
614610
},
615-
// This test passes because there is not address validation for clawback. Is this correct?
616-
// {
617-
// key: 'clawback[0]',
618-
// mode: 'invalid',
619-
// value: 'invalid-address',
620-
// expected: 'Error in transaction at index 0 in the following fields: sender-value, sender-value',
621-
// },
622611
{
623612
key: 'fee[0]',
624613
mode: 'invalid',

src/features/transaction-wizard/utils/transform-search-params-transactions.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ const transformAssetOptInTransaction = (params: BaseSearchParamTransaction): Bui
140140
id: BigInt(params.assetid),
141141
decimals: params.decimals ? Number(params.decimals) : undefined,
142142
unitName: params.unitname,
143-
clawback: params.clawback,
144143
},
145144
fee: params.fee ? { setAutomatically: false, value: microAlgo(Number(params.fee)).algo } : { setAutomatically: true },
146145
validRounds: {

0 commit comments

Comments
 (0)