Skip to content

Commit

Permalink
CLI pre-flight check fix (#3089)
Browse files Browse the repository at this point in the history
### Description

Only check origin balances for CLI send commands

### Related issues

Fixes #3079

### Backward compatibility

Yes

### Testing

Tested command locally
  • Loading branch information
jmrossy authored Dec 20, 2023
1 parent c2cf7be commit 05a943b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/witty-jobs-sit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hyperlane-xyz/cli': patch
---

Skip mandatory balance check for remotes in send commands"
14 changes: 13 additions & 1 deletion typescript/cli/src/deploy/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ export async function runPreflightChecks({
signer,
multiProvider,
minGas,
chainsToGasCheck,
}: {
origin: ChainName;
remotes: ChainName[];
signer: ethers.Signer;
multiProvider: MultiProvider;
minGas: string;
chainsToGasCheck?: ChainName[];
}) {
log('Running pre-flight checks...');

Expand All @@ -37,6 +39,7 @@ export async function runPreflightChecks({
signer,
multiProvider,
minGas,
chainsToGasCheck,
});
}

Expand All @@ -45,11 +48,15 @@ export async function runPreflightChecksForChains({
signer,
multiProvider,
minGas,
chainsToGasCheck,
}: {
chains: ChainName[];
signer: ethers.Signer;
multiProvider: MultiProvider;
minGas: string;
// Chains for which to assert a native balance
// Defaults to all chains if not specified
chainsToGasCheck?: ChainName[];
}) {
log('Running pre-flight checks...');

Expand All @@ -65,7 +72,12 @@ export async function runPreflightChecksForChains({
assertSigner(signer);
logGreen('Signer is valid ✅');

await assertGasBalances(multiProvider, signer, chains, minGas);
await assertGasBalances(
multiProvider,
signer,
chainsToGasCheck ?? chains,
minGas,
);
logGreen('Balances are sufficient ✅');
}

Expand Down
1 change: 1 addition & 0 deletions typescript/cli/src/send/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export async function sendTestMessage({
multiProvider,
signer,
minGas: MINIMUM_TEST_SEND_GAS,
chainsToGasCheck: [origin],
});

await timeout(
Expand Down
1 change: 1 addition & 0 deletions typescript/cli/src/send/transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export async function sendTestTransfer({
multiProvider,
signer,
minGas: MINIMUM_TEST_SEND_GAS,
chainsToGasCheck: [origin],
});

await timeout(
Expand Down

0 comments on commit 05a943b

Please sign in to comment.