mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-22 03:29:43 +00:00
feat(@embark/site): add section on getting account from describe
This commit is contained in:
parent
332229ff9d
commit
5044403a03
@ -161,7 +161,17 @@ config({
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
Notice that we're introducing a global `accounts` variable so we can mutate its state once the accounts are loaded. This is necessary to make the emitted accounts available in any of our spec blocks.
|
You can also grab the accounts from the callback of the `contract()` function (`describe` alias):
|
||||||
|
|
||||||
|
```
|
||||||
|
contract('SomeContract', (accounts) => {
|
||||||
|
const myAccounts = accounts[0];
|
||||||
|
|
||||||
|
it('should do something', async () => {
|
||||||
|
...
|
||||||
|
});
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
## Connecting to a different node
|
## Connecting to a different node
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user