Skip to content

Commit 45a07fd

Browse files
authored
fix: display public key in Sign Message result component (#1579)
The result of a CIP-8 operation requires the public key to verify the signature that's currently shown. This change displays the key in the result component, as a starting point to at least display the value, prior to a potential rework now there's two values to copy.
1 parent 594bbd0 commit 45a07fd

File tree

4 files changed

+49
-12
lines changed

4 files changed

+49
-12
lines changed

apps/browser-extension-wallet/src/views/browser-view/features/sign-message/SignMessageDrawer.tsx

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -125,17 +125,29 @@ export const SignMessageDrawer: React.FC = () => {
125125

126126
const renderSignature = () => (
127127
<div className={styles.inputGroup}>
128-
<ResultMessage
129-
customBgImg={CheckSuccessImg}
130-
title={t('core.signMessage.successTitle')}
131-
description={t('core.signMessage.successDescription')}
132-
/>
133-
<TextArea
134-
value={signatureObject.signature}
135-
dataTestId="sign-message-signature"
136-
rows={4}
137-
className={styles.customTextArea}
138-
/>
128+
<ResultMessage customBgImg={CheckSuccessImg} title={t('core.signMessage.successTitle')} />
129+
<div className={styles.inputGroup}>
130+
<Text.Body.Normal weight="$medium" data-testid={'result-message-signature-label'}>
131+
{t('core.signMessage.signature')}
132+
</Text.Body.Normal>
133+
<TextArea
134+
value={signatureObject.signature}
135+
dataTestId="sign-message-signature"
136+
rows={4}
137+
className={styles.customTextArea}
138+
/>
139+
</div>
140+
<div className={styles.inputGroup}>
141+
<Text.Body.Normal weight="$medium" data-testid={'result-message-key-label'}>
142+
{t('core.signMessage.key')}
143+
</Text.Body.Normal>
144+
<TextArea
145+
value={signatureObject.key}
146+
dataTestId="sign-message-key"
147+
rows={4}
148+
className={styles.customTextArea}
149+
/>
150+
</div>
139151
</div>
140152
);
141153

packages/e2e-tests/src/assert/settings/MessageSigningAllDoneDrawerAssert.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ class MessageSigningAllDoneDrawerAssert {
2121
await MessageSigningAllDoneDrawer.signature.waitForDisplayed();
2222
expect(await MessageSigningAllDoneDrawer.signature.getText()).to.not.be.empty;
2323

24+
await MessageSigningAllDoneDrawer.signatureLabel.waitForDisplayed();
25+
expect(await MessageSigningAllDoneDrawer.signatureLabel.getText()).to.not.be.empty;
26+
27+
await MessageSigningAllDoneDrawer.key.waitForDisplayed();
28+
expect(await MessageSigningAllDoneDrawer.key.getText()).to.not.be.empty;
29+
30+
await MessageSigningAllDoneDrawer.keyLabel.waitForDisplayed();
31+
expect(await MessageSigningAllDoneDrawer.keyLabel.getText()).to.not.be.empty;
32+
2433
await MessageSigningAllDoneDrawer.copyButton.waitForClickable();
2534
expect(await MessageSigningAllDoneDrawer.copyButton.getText()).to.equal(
2635
await t('core.signMessage.copyToClipboard')

packages/e2e-tests/src/elements/settings/MessageSigningAllDoneDrawer.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ class MessageSigningAllDoneDrawer extends CommonDrawerElements {
77
private TITLE = '[data-testid="result-message-title"]';
88
private DESCRIPTION = '[data-testid="result-message-description"]';
99
private SIGNATURE = '[data-testid="sign-message-signature"]';
10+
private SIGNATURE_LABEL = '[data-testid="result-message-signature-label"]';
11+
private KEY = '[data-testid="sign-message-key"]';
12+
private KEY_LABEL = '[data-testid="result-message-key-label"]';
1013
private COPY_BUTTON = '[data-testid="copy-button"]';
1114
private CLOSE_BUTTON = '[data-testid="close-button"]';
1215

@@ -26,6 +29,18 @@ class MessageSigningAllDoneDrawer extends CommonDrawerElements {
2629
return $(this.SIGNATURE);
2730
}
2831

32+
get signatureLabel(): ChainablePromiseElement<WebdriverIO.Element> {
33+
return $(this.SIGNATURE_LABEL);
34+
}
35+
36+
get key(): ChainablePromiseElement<WebdriverIO.Element> {
37+
return $(this.KEY);
38+
}
39+
40+
get keyLabel(): ChainablePromiseElement<WebdriverIO.Element> {
41+
return $(this.KEY_LABEL);
42+
}
43+
2944
get copyButton(): ChainablePromiseElement<WebdriverIO.Element> {
3045
return $(this.COPY_BUTTON);
3146
}

packages/translation/src/lib/translations/core/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@
222222
"core.signMessage.pleaseConfirmOnDevice": "Please confirm the signing operation on your hardware wallet device.",
223223
"core.signMessage.copyToClipboard": "Copy signature to clipboard",
224224
"core.signMessage.successTitle": "All done!",
225-
"core.signMessage.successDescription": "This is the signature of your signed message",
225+
"core.signMessage.signature": "Signature",
226+
"core.signMessage.key": "Public Key",
226227
"core.signMessage.nextButton": "Next",
227228
"core.signMessage.closeButton": "Close",
228229
"core.signMessage.signButton": "Sign message",

0 commit comments

Comments
 (0)