retryAsync inside getSafeAndService

pull/4800/head
Trevor Porter 1 week ago
parent e5a738f364
commit 39dae95ea7
  1. 6
      typescript/infra/src/tx/govern-transaction-reader.ts
  2. 10
      typescript/infra/src/utils/safe.ts

@ -486,8 +486,10 @@ export class GovernTransactionReader {
return undefined; return undefined;
} }
const { safeSdk } = await retryAsync(() => const { safeSdk } = await getSafeAndService(
getSafeAndService(chain, this.multiProvider, safe), chain,
this.multiProvider,
safe,
); );
this.multiSendCallOnlyAddressCache[chain] = this.multiSendCallOnlyAddressCache[chain] =

@ -14,7 +14,7 @@ import {
getSafe, getSafe,
getSafeService, getSafeService,
} from '@hyperlane-xyz/sdk'; } from '@hyperlane-xyz/sdk';
import { Address, CallData, eqAddress } from '@hyperlane-xyz/utils'; import { Address, CallData, eqAddress, retryAsync } from '@hyperlane-xyz/utils';
import safeSigners from '../../config/environments/mainnet3/safe/safeSigners.json' assert { type: 'json' }; import safeSigners from '../../config/environments/mainnet3/safe/safeSigners.json' assert { type: 'json' };
import { AnnotatedCallData } from '../govern/HyperlaneAppGovernor.js'; import { AnnotatedCallData } from '../govern/HyperlaneAppGovernor.js';
@ -24,10 +24,10 @@ export async function getSafeAndService(
multiProvider: MultiProvider, multiProvider: MultiProvider,
safeAddress: Address, safeAddress: Address,
) { ) {
const safeSdk: Safe.default = await getSafe( const safeSdk: Safe.default = await retryAsync(
chain, () => getSafe(chain, multiProvider, safeAddress),
multiProvider, 5,
safeAddress, 1000,
); );
const safeService: SafeApiKit.default = getSafeService(chain, multiProvider); const safeService: SafeApiKit.default = getSafeService(chain, multiProvider);
return { safeSdk, safeService }; return { safeSdk, safeService };

Loading…
Cancel
Save