Lesson 14: BasicNft.test.js #5234
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hello @AnneBBB, by default The reason there is a So, using |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Hello @AnneBBB, by default The reason there is a So, using |
Beta Was this translation helpful? Give feedback.
Hello @AnneBBB, by default
hardhat
provides an array of 20 accounts for local testing and you can get them withethers.getSigners()
.The reason there is a
namedAccounts
config in thehardhat.config
file is because we are using thehardhat-deploy
plugin that allows us to give a name or an alias to those accounts. The plugin also provides thegetNamedAccounts
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
orethers.getSigners()
does basically the same. What you need to understand is thatgetNamedAccounts
is only accesible as long you've installed the