Skip to content

Commit 472bbd9

Browse files
committed
fix(core): nullish
1 parent ea3533f commit 472bbd9

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

.changeset/three-dolphins-develop.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'micro-stacks': patch
3+
---
4+
5+
This update fixes a small bug where the nullish operator would always return a value and prevent legacy hashed messages from being verified.

packages/core/src/connect/message-signing/verify.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,13 @@ export const verifyMessageSignature = (options: {
149149
stxAddress?: string;
150150
mode?: 'vrs' | 'rsv';
151151
}) => {
152-
const isValid = _verifyMessageSignature(options);
153-
return isValid
154-
? true
155-
: _verifyMessageSignature({
156-
...options,
157-
prefix: LEGACY_CHAIN_PREFIX_BYTES,
158-
});
152+
return (
153+
_verifyMessageSignature(options) ||
154+
_verifyMessageSignature({
155+
...options,
156+
prefix: LEGACY_CHAIN_PREFIX_BYTES,
157+
})
158+
);
159159
};
160160

161161
export const verifyStructuredMessageSignature = (options: {
@@ -166,9 +166,8 @@ export const verifyStructuredMessageSignature = (options: {
166166
stxAddress?: string;
167167
mode?: 'vrs' | 'rsv';
168168
}) => {
169-
const isValid = _verifyStructuredMessageSignature(options);
170169
return (
171-
isValid ??
170+
_verifyStructuredMessageSignature(options) ||
172171
_verifyStructuredMessageSignature({
173172
...options,
174173
prefix: LEGACY_CHAIN_PREFIX_BYTES,

0 commit comments

Comments
 (0)