You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Test.assert(supply > 0.0, message: "FlowToken supply should be positive")
187
185
}
@@ -232,7 +230,7 @@ This will output the new account address. Use this address as the mainnet alias
232
230
This creates a local account with a mainnet-format address for fork testing. When you're ready to deploy to actual mainnet, you'll use this same account—see the [Deploying Contracts guide](pathname:///build/cadence/smart-contracts/deploying) for details.
233
231
:::
234
232
235
-
### Create a Contract that Uses FlowToken
233
+
### Create a Contract that Uses `FlowToken`
236
234
237
235
Generate a new contract:
238
236
@@ -246,17 +244,17 @@ This creates `cadence/contracts/TokenChecker.cdc` and adds it to `flow.json`. No
246
244
import "FlowToken"
247
245
248
246
access(all) contract TokenChecker {
249
-
247
+
250
248
access(all) fun checkBalance(address: Address): UFix64 {
@@ -288,7 +286,7 @@ Update your `flow.json` to include the contract with aliases, using the address
288
286
}
289
287
```
290
288
291
-
Note: No local private key is required for forked tests. The accounts entry above is included so you can copy/reference the address in your config; keys can be omitted for fork tests. Contracts deploy to the testing environment at `testing` alias, and transactions that interact with forked state can use impersonation. The `Test.deployContract` function will automatically deploy your contract to the testing environment during test execution.
289
+
**Note:** No local private key is required for forked tests. The accounts entry above is included so you can copy/reference the address in your config; keys can be omitted for fork tests. Contracts deploy to the testing environment at `testing` alias, and transactions that interact with forked state can use impersonation. The `Test.deployContract` function will automatically deploy your contract to the testing environment during test execution.
292
290
293
291
### Create Scripts for Testing
294
292
@@ -348,9 +346,9 @@ access(all) fun testCheckBalanceOnRealAccount() {
348
346
Test.readFile("../scripts/CheckBalance.cdc"),
349
347
[Address(0x1654653399040a61)] // Flow service account on mainnet
350
348
)
351
-
349
+
352
350
Test.expect(scriptResult, Test.beSucceeded())
353
-
351
+
354
352
let balance = scriptResult.returnValue! as! UFix64
355
353
// The Flow service account should have a balance
356
354
Test.assert(balance > 0.0, message: "Service account should have FLOW tokens")
@@ -361,9 +359,9 @@ access(all) fun testHasMinimumBalance() {
0 commit comments