Skip to content

Conversation

@juannyG
Copy link
Contributor

@juannyG juannyG commented Oct 23, 2024

The guidance provided by the foundry book informs us to setup our tests via

contract MyTest is Test {
...
}

However, given the inheritance and import structures of forge-std/Test.sol, the documentation to create a wallet produces the following error:

Compiler run failed:
Error (7920): Identifier not found or not unique.
  --> test/MyTest.t.sol:86:5:
   |
86 |     Wallet memory _w = vm.createWallet(100);
   |     ^^^^^^

Error: 

Instead, in order to store the result returned by vm.createWallet, I had to reference the Wallet type through the Vm interface, like so:

Vm.Wallet memory _w = vm.createWallet(100);

The guidance provided by the foundry book informs us to setup our tests via
```
contract MyTest is Test {
...
}
```

However, given the inheritance and import structures of `forge-std/Test.sol`, the documentation to create a wallet produces the following error:

```
Compiler run failed:
Error (7920): Identifier not found or not unique.
  --> test/MyTest.t.sol:86:5:
   |
86 |     Wallet memory _w = vm.createWallet(100);
   |     ^^^^^^

Error: 
```

Instead, in order to store the result returned by `vm.createWallet`, I had to reference the `Wallet` type through the `Vm` interface, like so:
```
Vm.Wallet memory _w = vm.createWallet(100);
```
Copy link
Member

@DaniPopes DaniPopes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@DaniPopes DaniPopes merged commit c354d9d into foundry-rs:master Oct 23, 2024
1 check passed
@juannyG
Copy link
Contributor Author

juannyG commented Oct 23, 2024

@all-contributors please add @juannyG for updating the createWallet docs

@allcontributors
Copy link
Contributor

@juannyG

I've put up a pull request to add @juannyG! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants