Is there a way in truffle develop tests to access the list of private keys in the same way we can access the list of accounts?
Basically, for every contract I need to test, the truffle test contract begins like :
contract("Testing Public Pool",function(accounts){....}
"accounts" is an array with the 10 default accounts generated by truffle when running the "truffle develop" command.
But is there a similar array for the private keys (that are also displayed when running the command)? I know I could copy/paste them manually but it is kind of annoying….
Best Answer
I think there are two possible solutions to this.
HDWalletProvider
https://www.npmjs.com/package/@truffle/hdwallet-provider
You can configure it in your
truffle-config.js
How to get private keys on Truffle from Ganache accounts