File tree Expand file tree Collapse file tree
typescript/rebalancer/src/core Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88 type MultiProvider ,
99 Token ,
1010 ProviderType ,
11+ SealevelCoreAdapter ,
1112 TOKEN_COLLATERALIZED_STANDARDS ,
1213 TokenAmount ,
1314 type WarpTypedTransaction ,
@@ -16,7 +17,12 @@ import {
1617 getSignerForChain ,
1718 type TypedTransactionReceipt ,
1819} from '@hyperlane-xyz/sdk' ;
19- import { ProtocolType , assert , isZeroishAddress } from '@hyperlane-xyz/utils' ;
20+ import {
21+ ProtocolType ,
22+ assert ,
23+ ensure0x ,
24+ isZeroishAddress ,
25+ } from '@hyperlane-xyz/utils' ;
2026
2127import type { ExternalBridgeType } from '../config/types.js' ;
2228import type {
@@ -1045,11 +1051,8 @@ export class InventoryRebalancer implements IInventoryRebalancer {
10451051 | string [ ]
10461052 | undefined ;
10471053 if ( ! logs ) return undefined ;
1048- const regex = / D i s p a t c h e d m e s s a g e t o ( .* ) , I D ( .* ) / ;
1049- const dispatchLog = logs . find ( ( log ) => regex . test ( log ) ) ;
1050- if ( ! dispatchLog ) return undefined ;
1051- const [ , _destination , messageId ] = regex . exec ( dispatchLog ) ?? [ ] ;
1052- return messageId ? `0x${ messageId . replace ( / ^ 0 x / , '' ) } ` : undefined ;
1054+ const parsed = SealevelCoreAdapter . parseMessageDispatchLogs ( logs ) ;
1055+ return parsed [ 0 ] ?. messageId ? ensure0x ( parsed [ 0 ] . messageId ) : undefined ;
10531056 }
10541057
10551058 return undefined ;
You can’t perform that action at this time.
0 commit comments