Skip to content

Lesson 14: BasicNft.test.js #5234

Answered by pacelliv
chopperttt asked this question in Q&A
Apr 4, 2023 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

Hello @AnneBBB, by default hardhat provides an array of 20 accounts for local testing and you can get them with ethers.getSigners().

The reason there is a namedAccounts config in the hardhat.config file is because we are using the hardhat-deploy plugin that allows us to give a name or an alias to those accounts. The plugin also provides the getNamedAccounts helper function that allows us to fetch the accounts we named in the config, but in the end those accounts that you named are the same accounts provided by hardhat.

So, using getNamedAccounts or ethers.getSigners() does basically the same. What you need to understand is that getNamedAccounts is only accesible as long you've installed the

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@pacelliv
Comment options

@chopperttt
Comment options

@pacelliv
Comment options

@chopperttt
Comment options

Answer selected by chopperttt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants