File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @hyperlane-xyz/sdk " : minor
3+ ---
4+
5+ Update fetchPackageVersion() to return 0.0.0 when unknown error is thrown. This error is logged out and is no longer rethrown.
Original file line number Diff line number Diff line change @@ -256,7 +256,7 @@ export class EvmERC20WarpRouteReader extends EvmRouterReader {
256256 ) ;
257257
258258 const [ packageVersion , tokenFee ] = await Promise . all ( [
259- this . fetchPackageVersion ( routerAddress ) . catch ( ( ) => '0.0.0' ) ,
259+ this . fetchPackageVersion ( routerAddress ) ,
260260 TokenRouter . feeRecipient ( ) . catch ( ( ) => constants . AddressZero ) ,
261261 ] ) ;
262262
@@ -992,13 +992,14 @@ export class EvmERC20WarpRouteReader extends EvmRouterReader {
992992 try {
993993 return await contractWithVersion . PACKAGE_VERSION ( ) ;
994994 } catch ( err : any ) {
995- if ( err . cause . code && err . cause . code === 'CALL_EXCEPTION' ) {
995+ if ( err . cause ? .code && err . cause ? .code === 'CALL_EXCEPTION' ) {
996996 // PACKAGE_VERSION was introduced in @hyperlane -xyz/[email protected] 997997 // See https://github.com/hyperlane-xyz/hyperlane-monorepo/releases/tag/%40hyperlane-xyz%2Fcore%405.4.0
998998 // The real version of a contract without this function is below 5.4.0
999999 return '5.3.9' ;
10001000 } else {
1001- throw err ;
1001+ this . logger . error ( `Error when fetching package version ${ err } ` ) ;
1002+ return '0.0.0' ;
10021003 }
10031004 }
10041005 }
You can’t perform that action at this time.
0 commit comments