Skip to content

Commit 910b32a

Browse files
Merge pull request #7472 from BitGo/COIN-6446
fix: canton isValidAddress method issue handling
2 parents e27bdac + b354646 commit 910b32a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

modules/sdk-coin-canton/src/lib/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class Utils implements BaseUtils {
1616
if (!address || address.trim() === '') return false;
1717
const [partyHint, fingerprint] = address.trim().split('::');
1818
if (!partyHint || !fingerprint) return false;
19-
return partyHint.length === 5 && this.isValidCantonHex(fingerprint);
19+
return partyHint.length >= 5 && this.isValidCantonHex(fingerprint);
2020
}
2121

2222
/** @inheritdoc */

modules/sdk-coin-canton/test/resources.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ export const InvalidOneStepPreApprovalPrepareResponse = {
7272

7373
export const CANTON_ADDRESSES = {
7474
VALID_ADDRESS: '1220a::1220a43d89dc7d8f85316116aac093667f769fce55411aef6846ccb933b2e1a3b598',
75-
// party hint is not 5 characters
76-
INVALID_PARTY_HINT: '123456::1220a43d89dc7d8f85316116aac093667f769fce55411aef6846ccb933b2e1a3b598',
75+
// party hint is not greater than or equal to 5 characters
76+
INVALID_PARTY_HINT: '1234::1220a43d89dc7d8f85316116aac093667f769fce55411aef6846ccb933b2e1a3b598',
7777
// fingerprint is not a valid hex value
7878
INVALID_FINGERPRINT: '12205::12205b4e3537a95126d9060459234gd8ad3c3ddccda4f79901954280ee19c576714d',
7979
MISSING_PARTY_HINT: '::12205b4e3537a95126d9060459234gd8ad3c3ddccda4f79901954280ee19c576714d',

0 commit comments

Comments
 (0)