Skip to content

Commit 6c106c2

Browse files
fix: Missing Unlimited as value for the DAI permit
1 parent 715eb4f commit 6c106c2

File tree

11 files changed

+61
-288
lines changed

11 files changed

+61
-288
lines changed

test/integration/confirmations/signatures/permit-batch.test.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,12 @@ describe('Permit Batch Signature Tests', () => {
100100

101101
const simulationDetails = [
102102
'Estimated changes',
103-
"You're giving the spender permission to spend this many tokens from your account.",
103+
"You're removing the spender permission to spend this many tokens from your account.",
104104
'Spending cap',
105105
'0xA0b86...6eB48',
106-
'1,461,501,637,3...',
106+
'Unlimited',
107107
'0xb0B86...6EB48',
108-
'2,461,501,637,3...',
108+
'Unlimited',
109109
];
110110

111111
verifyDetails(simulationSection, simulationDetails);

test/integration/confirmations/signatures/permit-single.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ describe('Permit Single Signature Tests', () => {
9898
);
9999
const simulationDetails = [
100100
'Estimated changes',
101-
"You're giving the spender permission to spend this many tokens from your account.",
101+
"You're removing the spender permission to spend this many tokens from your account.",
102102
'Spending cap',
103103
'0xA0b86...6eB48',
104-
'1,461,501,637,3...',
104+
'Unlimited',
105105
];
106106

107107
expect(simulationSection).toBeInTheDocument();

test/integration/confirmations/signatures/permit.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ describe('Permit Confirmation', () => {
235235
expect(simulationSection).toBeInTheDocument();
236236
expect(simulationSection).toHaveTextContent('Estimated changes');
237237
expect(simulationSection).toHaveTextContent(
238-
"You're giving the spender permission to spend this many tokens from your account.",
238+
"You're removing the spender permission to spend this many tokens from your account.",
239239
);
240240
expect(simulationSection).toHaveTextContent('Spending cap');
241241
expect(simulationSection).toHaveTextContent('0xCcCCc...ccccC');

ui/components/app/snaps/snap-ui-address/__snapshots__/snap-ui-address.test.tsx.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ exports[`SnapUIAddress renders Ethereum address 1`] = `
172172
<rect
173173
fill="#F29602"
174174
height="32"
175-
transform="translate(-2.81750896228304 4.951916544006229) rotate(230.4 16 16)"
175+
transform="translate(-2.8175089622830405 4.951916544006229) rotate(230.4 16 16)"
176176
width="32"
177177
x="0"
178178
y="0"
@@ -476,7 +476,7 @@ exports[`SnapUIAddress renders legacy Ethereum address 1`] = `
476476
<rect
477477
fill="#F29602"
478478
height="32"
479-
transform="translate(-2.81750896228304 4.951916544006229) rotate(230.4 16 16)"
479+
transform="translate(-2.8175089622830405 4.951916544006229) rotate(230.4 16 16)"
480480
width="32"
481481
x="0"
482482
y="0"

ui/components/multichain/connect-accounts-modal/__snapshots__/connect-accounts-modal.test.tsx.snap

+4-4
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ exports[`Connect More Accounts Modal should render correctly 1`] = `
159159
<rect
160160
fill="#FA4300"
161161
height="32"
162-
transform="translate(-1.712066926084717 -0.6920409130150889) rotate(264.3 16 16)"
162+
transform="translate(-1.712066926084717 -0.6920409130150887) rotate(264.3 16 16)"
163163
width="32"
164164
x="0"
165165
y="0"
@@ -202,7 +202,7 @@ exports[`Connect More Accounts Modal should render correctly 1`] = `
202202
<rect
203203
fill="#FA4300"
204204
height="32"
205-
transform="translate(-1.712066926084717 -0.6920409130150889) rotate(264.3 16 16)"
205+
transform="translate(-1.712066926084717 -0.6920409130150887) rotate(264.3 16 16)"
206206
width="32"
207207
x="0"
208208
y="0"
@@ -261,7 +261,7 @@ exports[`Connect More Accounts Modal should render correctly 1`] = `
261261
<rect
262262
fill="#FA4300"
263263
height="32"
264-
transform="translate(-1.712066926084717 -0.6920409130150889) rotate(264.3 16 16)"
264+
transform="translate(-1.712066926084717 -0.6920409130150887) rotate(264.3 16 16)"
265265
width="32"
266266
x="0"
267267
y="0"
@@ -304,7 +304,7 @@ exports[`Connect More Accounts Modal should render correctly 1`] = `
304304
<rect
305305
fill="#FA4300"
306306
height="32"
307-
transform="translate(-1.712066926084717 -0.6920409130150889) rotate(264.3 16 16)"
307+
transform="translate(-1.712066926084717 -0.6920409130150887) rotate(264.3 16 16)"
308308
width="32"
309309
x="0"
310310
y="0"

ui/pages/confirmations/components/confirm/info/typed-sign/__snapshots__/typed-sign.test.tsx.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ exports[`TypedSignInfo correctly renders permit sign type 1`] = `
4545
class="mm-box mm-text mm-text--body-md mm-box--color-inherit"
4646
style="white-space: pre-wrap;"
4747
>
48-
You're giving the spender permission to spend this many tokens from your account.
48+
You're removing the spender permission to spend this many tokens from your account.
4949
</p>
5050
</div>
5151
</div>
@@ -420,7 +420,7 @@ exports[`TypedSignInfo correctly renders permit sign type with no deadline 1`] =
420420
class="mm-box mm-text mm-text--body-md mm-box--color-inherit"
421421
style="white-space: pre-wrap;"
422422
>
423-
You're giving the spender permission to spend this many tokens from your account.
423+
You're removing the spender permission to spend this many tokens from your account.
424424
</p>
425425
</div>
426426
</div>

ui/pages/confirmations/components/confirm/info/typed-sign/typed-sign-v4-simulation/permit-simulation/__snapshots__/permit-simulation.test.tsx.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ exports[`PermitSimulation renders component correctly 1`] = `
4545
class="mm-box mm-text mm-text--body-md mm-box--color-inherit"
4646
style="white-space: pre-wrap;"
4747
>
48-
You're giving the spender permission to spend this many tokens from your account.
48+
You're removing the spender permission to spend this many tokens from your account.
4949
</p>
5050
</div>
5151
</div>

ui/pages/confirmations/components/confirm/info/typed-sign/typed-sign-v4-simulation/permit-simulation/permit-simulation.tsx

+10-7
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,20 @@ const PermitSimulation: React.FC<object> = () => {
107107
</ConfirmInfoRow>
108108
);
109109

110+
let descriptionKey;
111+
if (isNFT) {
112+
descriptionKey = 'simulationDetailsApproveDesc';
113+
} else if (message.allowed === true) {
114+
descriptionKey = 'permitSimulationDetailInfo';
115+
} else {
116+
descriptionKey = 'permitRevokeSimulationDetailInfo';
117+
}
118+
110119
return (
111120
<StaticSimulation
112121
title={t('simulationDetailsTitle')}
113122
titleTooltip={t('simulationDetailsTitleTooltip')}
114-
description={t(
115-
isNFT
116-
? 'simulationDetailsApproveDesc'
117-
: message.allowed === true
118-
? 'permitSimulationDetailInfo'
119-
: 'permitRevokeSimulationDetailInfo',
120-
)}
123+
description={t(descriptionKey)}
121124
simulationElements={SpendingCapRow}
122125
/>
123126
);

ui/pages/confirmations/components/confirm/info/typed-sign/typed-sign-v4-simulation/typed-sign-v4-simulation.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ describe('PermitSimulation', () => {
6868
expect(await findByText('Estimated changes')).toBeInTheDocument();
6969
expect(
7070
await findByText(
71-
"You're giving the spender permission to spend this many tokens from your account.",
71+
"You're removing the spender permission to spend this many tokens from your account.",
7272
),
7373
).toBeInTheDocument();
7474
});
@@ -103,7 +103,7 @@ describe('PermitSimulation', () => {
103103
expect(await findByText('Estimated changes')).toBeInTheDocument();
104104
expect(
105105
await findByText(
106-
"You're giving the spender permission to spend this many tokens from your account.",
106+
"You're removing the spender permission to spend this many tokens from your account.",
107107
),
108108
).toBeInTheDocument();
109109
});

0 commit comments

Comments
 (0)