-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the Faucet class and fix param naming
- Loading branch information
1 parent
335a60f
commit 659c2f4
Showing
4 changed files
with
45 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright © Aptos Foundation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { Aptos } from "../../../src/api/aptos"; | ||
import { AptosConfig } from "../../../src/api/aptos_config"; | ||
import { Account } from "../../../src/core/account"; | ||
import { SigningScheme } from "../../../src/types"; | ||
import { Network } from "../../../src/utils/apiEndpoints"; | ||
|
||
describe("Faucet", () => { | ||
test("it should fund an account", async () => { | ||
const config = new AptosConfig({ network: Network.LOCAL }); | ||
const aptos = new Aptos(config); | ||
const testAccount = Account.generate({ scheme: SigningScheme.Ed25519 }); | ||
|
||
// Fund the account | ||
await aptos.fundAccount({ accountAddress: testAccount.accountAddress.toString(), amount: 10_000_000 }); | ||
|
||
// Check the balance | ||
let resource = await aptos.getAccountResource({ | ||
accountAddress: testAccount.accountAddress.toString(), | ||
resourceType: "0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>", | ||
}); | ||
let amount = Number((resource.data as { coin: { value: string } }).coin.value); | ||
expect(amount).toBe(10_000_000); | ||
}); | ||
}); |