File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,7 +61,12 @@ export class PublicKeysRepository extends ExtendedBaseRepository<PublicKeyDocume
6161 this . network ,
6262 ) ;
6363
64- promises . push ( this . getKeyInfo ( addressOrPublicKeys [ i ] , isPublicKey ) ) ;
64+ const isContract = AddressVerificator . isValidP2OPAddress (
65+ addressOrPublicKeys [ i ] ,
66+ this . network ,
67+ ) ;
68+
69+ promises . push ( this . getKeyInfo ( addressOrPublicKeys [ i ] , isPublicKey , isContract ) ) ;
6570 }
6671
6772 const results = await Promise . safeAll ( promises ) ;
@@ -462,6 +467,7 @@ export class PublicKeysRepository extends ExtendedBaseRepository<PublicKeyDocume
462467 private async getKeyInfo (
463468 key : string ,
464469 isPublicKey : boolean ,
470+ isContract : boolean ,
465471 ) : Promise < PublicKeyWithMLDSA | IPubKeyNotFoundError > {
466472 try {
467473 const filter : Filter < PublicKeyDocument > = {
@@ -476,7 +482,7 @@ export class PublicKeysRepository extends ExtendedBaseRepository<PublicKeyDocume
476482
477483 return await this . getOneWithMLDSA ( filter ) ;
478484 } catch ( e ) {
479- if ( ! isPublicKey ) {
485+ if ( ! isContract ) {
480486 return {
481487 error : 'Public key not found (invalid key format, for contract address)' ,
482488 } ;
You can’t perform that action at this time.
0 commit comments