From 953015a1f1c5630dfe4c5985f9d9956f5e281d90 Mon Sep 17 00:00:00 2001 From: jsy1218 <91580504+jsy1218@users.noreply.github.com> Date: Wed, 15 Jan 2025 13:52:47 -0800 Subject: [PATCH] feedback --- src/providers/token-provider.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/providers/token-provider.ts b/src/providers/token-provider.ts index 3e1759510..51d09bb33 100644 --- a/src/providers/token-provider.ts +++ b/src/providers/token-provider.ts @@ -898,12 +898,19 @@ export class TokenProvider implements ITokenProvider { continue; } + let symbol; + try { - isBytes32 + symbol = isBytes32 ? parseBytes32String(symbolResult.result[0]!) : symbolResult.result[0]!; } catch (error) { - if (error instanceof Error && error.message.includes('invalid bytes32 string - no null terminator')) { + if ( + error instanceof Error && + error.message.includes( + 'invalid bytes32 string - no null terminator' + ) + ) { log.error( { symbolResult, @@ -911,13 +918,10 @@ export class TokenProvider implements ITokenProvider { }, `invalid bytes32 string - no null terminator` ); - continue; } - } - const symbol = isBytes32 - ? parseBytes32String(symbolResult.result[0]!) - : symbolResult.result[0]!; + throw error; + } const decimal = decimalResult.result[0]!; addressToToken[address.toLowerCase()] = new Token(