Skip to content

Commit

Permalink
fix: uses authkey to fund accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
codekitz authored and aptos-bot committed Apr 12, 2022
1 parent 7b5e1c3 commit 9efe13e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ export class FaucetClient {

/** This creates an account if it does not exist and mints the specified amount of
coins into that account */
async fundAccount(authKey: string, amount: number) {
const url = `${this.url}/mint?amount=${amount}&auth_key=${authKey}`;
async fundAccount(address: string, amount: number) {
const url = `${this.url}/mint?amount=${amount}&address=${address}`;
const response = await fetch(url, {method: "POST"});
if (response.status != 200) {
assert(response.status == 200, await response.text());
Expand Down Expand Up @@ -233,8 +233,8 @@ async function main() {
console.log(`Alice: ${alice.address()}. Key Seed: ${Buffer.from(alice.signingKey.secretKey).toString("hex").slice(0, 64)}`);
console.log(`Bob: ${bob.address()}. Key Seed: ${Buffer.from(bob.signingKey.secretKey).toString("hex").slice(0, 64)}`);

await faucetClient.fundAccount(alice.authKey(), 1_000_000_000);
await faucetClient.fundAccount(bob.authKey(), 0);
await faucetClient.fundAccount(alice.address(), 1_000_000_000);
await faucetClient.fundAccount(bob.address(), 0);

console.log("\n=== Initial Balances ===");
console.log(`Alice: ${await restClient.accountBalance(alice.address())}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ async function main() {
console.log(`Alice: ${alice.address()}`);
console.log(`Bob: ${bob.address()}`);

await faucetClient.fundAccount(alice.pubKey(), 10_000_000);
await faucetClient.fundAccount(bob.pubKey(), 10_000_000);
await faucetClient.fundAccount(alice.address(), 10_000_000);
await faucetClient.fundAccount(bob.address(), 10_000_000);

console.log("\n=== Initial Balances ===");
console.log(`Alice: ${await restClient.accountBalance(alice.address())}`);
Expand Down

0 comments on commit 9efe13e

Please sign in to comment.