File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff 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 this . isValidCantonHex ( fingerprint ) ;
2020 }
2121
2222 /** @inheritdoc */
Original file line number Diff line number Diff line change @@ -78,8 +78,8 @@ export const InvalidOneStepPreApprovalPrepareResponse = {
7878
7979export const CANTON_ADDRESSES = {
8080 VALID_ADDRESS : '1220a::1220a43d89dc7d8f85316116aac093667f769fce55411aef6846ccb933b2e1a3b598' ,
81- // party hint is not greater than or equal to 5 characters
82- INVALID_PARTY_HINT : '1234::1220a43d89dc7d8f85316116aac093667f769fce55411aef6846ccb933b2e1a3b598' ,
81+ // party hint should be present
82+ VALID_PARTY_HINT : '1234::1220a43d89dc7d8f85316116aac093667f769fce55411aef6846ccb933b2e1a3b598' ,
8383 // fingerprint is not a valid hex value
8484 INVALID_FINGERPRINT : '12205::12205b4e3537a95126d9060459234gd8ad3c3ddccda4f79901954280ee19c576714d' ,
8585 MISSING_PARTY_HINT : '::12205b4e3537a95126d9060459234gd8ad3c3ddccda4f79901954280ee19c576714d' ,
Original file line number Diff line number Diff line change @@ -115,9 +115,9 @@ describe('Canton Util', function () {
115115 } ) ;
116116
117117 it ( 'should return false when party hint is invalid' , function ( ) {
118- const isValid = utils . isValidAddress ( CANTON_ADDRESSES . INVALID_PARTY_HINT ) ;
118+ const isValid = utils . isValidAddress ( CANTON_ADDRESSES . VALID_PARTY_HINT ) ;
119119 should . exist ( isValid ) ;
120- assert . strictEqual ( isValid , false ) ;
120+ assert . strictEqual ( isValid , true ) ;
121121 } ) ;
122122
123123 it ( 'should return false when fingerprint is invalid' , function ( ) {
You can’t perform that action at this time.
0 commit comments