Skip to content

Commit e5b86b7

Browse files
feat: remove RLC balance check blocking deployment and add warning instead
1 parent 4967551 commit e5b86b7

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

cli/src/cmd/deploy.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import { hintBox } from '../cli-helpers/box.js';
2222
import { addDeploymentData } from '../utils/cacheExecutions.js';
2323
import { deployTdxApp, getIExecTdx } from '../utils/tdx-poc.js';
2424
import { useTdx } from '../utils/featureFlags.js';
25-
import { ensureBalances } from '../cli-helpers/ensureBalances.js';
2625
import { warnBeforeTxFees } from '../cli-helpers/warnBeforeTxFees.js';
2726

2827
export async function deploy({ chain }: { chain?: string }) {
@@ -46,7 +45,21 @@ export async function deploy({ chain }: { chain?: string }) {
4645
iexec = getIExec({ ...chainConfig, signer });
4746
}
4847

49-
await ensureBalances({ spinner, iexec });
48+
// Check balance and show warning if no RLC
49+
const chainId = await iexec.config.resolveChainId();
50+
const address = await iexec.wallet.getAddress();
51+
const [{ nRLC }, { stake }] = await Promise.all([
52+
iexec.wallet.checkBalances(address),
53+
iexec.account.checkBalance(address),
54+
]);
55+
56+
const totalRlc = stake.add(nRLC);
57+
58+
if (totalRlc.isZero() && chainId !== 134) {
59+
spinner.warn(
60+
`⚠️ Warning: Your wallet has no RLC balance. You'll need RLC to run your iApp later. Consider funding your wallet ${address} or importing another wallet.`
61+
);
62+
}
5063

5164
const dockerhubUsername = await askForDockerhubUsername({ spinner });
5265
const dockerhubAccessToken = await askForDockerhubAccessToken({ spinner });

0 commit comments

Comments
 (0)