Skip to content

Commit

Permalink
fix: faucet correctly derives its account (#7645)
Browse files Browse the repository at this point in the history
Fix faucet not being able to send funds because its account didn't have
any tokens.
  • Loading branch information
alexghr authored Jul 29, 2024
1 parent f48b069 commit 921773f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/devnet-deploys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ env:
TF_VAR_API_KEY: ${{ secrets.FORK_API_KEY }}
TF_VAR_FORK_MNEMONIC: ${{ secrets.FORK_MNEMONIC }}
TF_VAR_INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }}
TF_VAR_FAUCET_ACCOUNT_INDEX: 5
TF_VAR_FAUCET_ACCOUNT_INDEX: 9
TF_VAR_BOT_API_KEY: ${{ secrets.BOT_API_KEY }}
TF_VAR_BOT_PRIVATE_KEY: ${{ secrets.BOT_PRIVATE_KEY }}
CONTRACT_S3_BUCKET: s3://aztec-devnet-deployments
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/aztec-faucet/src/bin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ function updateThrottle(asset: 'eth' | AssetName, address: Hex) {
function getFaucetAccount(): LocalAccount {
let account: LocalAccount;
if (FORK_MNEMONIC) {
const accountIndex = Number.isNaN(+FAUCET_ACCOUNT_INDEX) ? 0 : +FAUCET_ACCOUNT_INDEX;
const index = Number.isNaN(+FAUCET_ACCOUNT_INDEX) ? 0 : +FAUCET_ACCOUNT_INDEX;
account = mnemonicToAccount(FORK_MNEMONIC, {
accountIndex,
addressIndex: index,
});
} else if (PRIVATE_KEY) {
account = privateKeyToAccount(PRIVATE_KEY as `0x${string}`);
Expand Down

0 comments on commit 921773f

Please sign in to comment.